Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
e370b43f
Commit
e370b43f
authored
Oct 26, 2021
by
Michael Howitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation warnings occurring on Python 3.10.
parent
ddf79d34
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
13 deletions
+15
-13
CHANGES.rst
CHANGES.rst
+2
-0
src/ZODB/FileStorage/FileStorage.py
src/ZODB/FileStorage/FileStorage.py
+2
-2
src/ZODB/scripts/fsstats.py
src/ZODB/scripts/fsstats.py
+2
-2
src/ZODB/tests/BasicStorage.py
src/ZODB/tests/BasicStorage.py
+3
-3
src/ZODB/tests/MTStorage.py
src/ZODB/tests/MTStorage.py
+5
-5
src/ZODB/tests/testThreadedShutdown.py
src/ZODB/tests/testThreadedShutdown.py
+1
-1
No files found.
CHANGES.rst
View file @
e370b43f
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
- Require Python 3 to build the documentation.
- Require Python 3 to build the documentation.
- Fix deprecation warnings occurring on Python 3.10.
5.6.0 (2020-06-11)
5.6.0 (2020-06-11)
==================
==================
...
...
src/ZODB/FileStorage/FileStorage.py
View file @
e370b43f
...
@@ -2161,7 +2161,7 @@ class FilePool(object):
...
@@ -2161,7 +2161,7 @@ class FilePool(object):
self
.
writing
=
False
self
.
writing
=
False
if
self
.
writers
>
0
:
if
self
.
writers
>
0
:
self
.
writers
-=
1
self
.
writers
-=
1
self
.
_cond
.
notify
A
ll
()
self
.
_cond
.
notify
_a
ll
()
@
contextlib
.
contextmanager
@
contextlib
.
contextmanager
def
get
(
self
):
def
get
(
self
):
...
@@ -2186,7 +2186,7 @@ class FilePool(object):
...
@@ -2186,7 +2186,7 @@ class FilePool(object):
if
not
self
.
_out
:
if
not
self
.
_out
:
with
self
.
_cond
:
with
self
.
_cond
:
if
self
.
writers
and
not
self
.
_out
:
if
self
.
writers
and
not
self
.
_out
:
self
.
_cond
.
notify
A
ll
()
self
.
_cond
.
notify
_a
ll
()
def
empty
(
self
):
def
empty
(
self
):
while
self
.
_files
:
while
self
.
_files
:
...
...
src/ZODB/scripts/fsstats.py
View file @
e370b43f
...
@@ -6,8 +6,8 @@ import sys
...
@@ -6,8 +6,8 @@ import sys
import
six
import
six
from
six.moves
import
filter
from
six.moves
import
filter
rx_txn
=
re
.
compile
(
"tid=([0-9a-f]+).*size=(
\
d+)
"
)
rx_txn
=
re
.
compile
(
r
"tid=([0-9a-f]+).*size=(\
d+)
")
rx_data = re.compile("
oid
=
([
0
-
9
a
-
f
]
+
)
size
=
(
\
d
+
)
class
=
(
\
S
+
)
")
rx_data = re.compile(
r
"
oid
=
([
0
-
9
a
-
f
]
+
)
size
=
(
\
d
+
)
class
=
(
\
S
+
)
")
def sort_byhsize(seq, reverse=False):
def sort_byhsize(seq, reverse=False):
L = [(v.size(), k, v) for k, v in seq]
L = [(v.size(), k, v) for k, v in seq]
...
...
src/ZODB/tests/BasicStorage.py
View file @
e370b43f
...
@@ -209,7 +209,7 @@ class BasicStorage(object):
...
@@ -209,7 +209,7 @@ class BasicStorage(object):
# We'll run the competing trans in a separate thread:
# We'll run the competing trans in a separate thread:
thread
=
threading
.
Thread
(
name
=
'T2'
,
thread
=
threading
.
Thread
(
name
=
'T2'
,
target
=
self
.
_dostore
,
args
=
(
oid
,),
kwargs
=
dict
(
revid
=
revid
))
target
=
self
.
_dostore
,
args
=
(
oid
,),
kwargs
=
dict
(
revid
=
revid
))
thread
.
setDaemon
(
True
)
thread
.
daemon
=
True
thread
.
start
()
thread
.
start
()
thread
.
join
(.
1
)
thread
.
join
(.
1
)
return
thread
return
thread
...
@@ -324,7 +324,7 @@ class BasicStorage(object):
...
@@ -324,7 +324,7 @@ class BasicStorage(object):
to_join
=
[]
to_join
=
[]
def
run_in_thread
(
func
):
def
run_in_thread
(
func
):
t
=
threading
.
Thread
(
target
=
func
)
t
=
threading
.
Thread
(
target
=
func
)
t
.
setDaemon
(
True
)
t
.
daemon
=
True
t
.
start
()
t
.
start
()
to_join
.
append
(
t
)
to_join
.
append
(
t
)
...
@@ -347,7 +347,7 @@ class BasicStorage(object):
...
@@ -347,7 +347,7 @@ class BasicStorage(object):
def
update_attempts
():
def
update_attempts
():
with
attempts_cond
:
with
attempts_cond
:
attempts
.
append
(
1
)
attempts
.
append
(
1
)
attempts_cond
.
notify
A
ll
()
attempts_cond
.
notify
_a
ll
()
@
run_in_thread
@
run_in_thread
...
...
src/ZODB/tests/MTStorage.py
View file @
e370b43f
...
@@ -50,7 +50,7 @@ class ZODBClientThread(TestThread):
...
@@ -50,7 +50,7 @@ class ZODBClientThread(TestThread):
def
__init__
(
self
,
db
,
test
,
commits
=
10
,
delay
=
SHORT_DELAY
):
def
__init__
(
self
,
db
,
test
,
commits
=
10
,
delay
=
SHORT_DELAY
):
self
.
__super_init
()
self
.
__super_init
()
self
.
setDaemon
(
1
)
self
.
daemon
=
True
self
.
db
=
db
self
.
db
=
db
self
.
test
=
test
self
.
test
=
test
self
.
commits
=
commits
self
.
commits
=
commits
...
@@ -76,7 +76,7 @@ class ZODBClientThread(TestThread):
...
@@ -76,7 +76,7 @@ class ZODBClientThread(TestThread):
time
.
sleep
(
self
.
delay
)
time
.
sleep
(
self
.
delay
)
# Return a new PersistentMapping, and store it on the root object under
# Return a new PersistentMapping, and store it on the root object under
# the name
(.getName())
of the current thread.
# the name of the current thread.
def
get_thread_dict
(
self
,
root
):
def
get_thread_dict
(
self
,
root
):
# This is vicious: multiple threads are slamming changes into the
# This is vicious: multiple threads are slamming changes into the
# root object, then trying to read the root object, simultaneously
# root object, then trying to read the root object, simultaneously
...
@@ -86,7 +86,7 @@ class ZODBClientThread(TestThread):
...
@@ -86,7 +86,7 @@ class ZODBClientThread(TestThread):
# around (at most) 1000 times was enough so that a 100-thread test
# around (at most) 1000 times was enough so that a 100-thread test
# reliably passed on Tim's hyperthreaded WinXP box (but at the
# reliably passed on Tim's hyperthreaded WinXP box (but at the
# original 10 retries, the same test reliably failed with 15 threads).
# original 10 retries, the same test reliably failed with 15 threads).
name
=
self
.
getName
()
name
=
self
.
name
MAXRETRIES
=
1000
MAXRETRIES
=
1000
for
i
in
range
(
MAXRETRIES
):
for
i
in
range
(
MAXRETRIES
):
...
@@ -129,7 +129,7 @@ class StorageClientThread(TestThread):
...
@@ -129,7 +129,7 @@ class StorageClientThread(TestThread):
data
,
serial
=
load_current
(
self
.
storage
,
oid
)
data
,
serial
=
load_current
(
self
.
storage
,
oid
)
self
.
test
.
assertEqual
(
serial
,
revid
)
self
.
test
.
assertEqual
(
serial
,
revid
)
obj
=
zodb_unpickle
(
data
)
obj
=
zodb_unpickle
(
data
)
self
.
test
.
assertEqual
(
obj
.
value
[
0
],
self
.
getName
()
)
self
.
test
.
assertEqual
(
obj
.
value
[
0
],
self
.
name
)
def
pause
(
self
):
def
pause
(
self
):
time
.
sleep
(
self
.
delay
)
time
.
sleep
(
self
.
delay
)
...
@@ -140,7 +140,7 @@ class StorageClientThread(TestThread):
...
@@ -140,7 +140,7 @@ class StorageClientThread(TestThread):
return
oid
return
oid
def
dostore
(
self
,
i
):
def
dostore
(
self
,
i
):
data
=
zodb_pickle
(
MinPO
((
self
.
getName
()
,
i
)))
data
=
zodb_pickle
(
MinPO
((
self
.
name
,
i
)))
t
=
TransactionMetaData
()
t
=
TransactionMetaData
()
oid
=
self
.
oid
()
oid
=
self
.
oid
()
self
.
pause
()
self
.
pause
()
...
...
src/ZODB/tests/testThreadedShutdown.py
View file @
e370b43f
...
@@ -12,7 +12,7 @@ class ZODBClientThread(threading.Thread):
...
@@ -12,7 +12,7 @@ class ZODBClientThread(threading.Thread):
def
__init__
(
self
,
db
,
test
):
def
__init__
(
self
,
db
,
test
):
threading
.
Thread
.
__init__
(
self
)
threading
.
Thread
.
__init__
(
self
)
self
.
_exc_info
=
None
self
.
_exc_info
=
None
self
.
setDaemon
(
True
)
self
.
daemon
=
True
self
.
db
=
db
self
.
db
=
db
self
.
test
=
test
self
.
test
=
test
self
.
event
=
threading
.
Event
()
self
.
event
=
threading
.
Event
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment