Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
c5273402
Commit
c5273402
authored
Dec 13, 2019
by
Stéphane Blondon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace deprecated occurences of Thread.isAlive() by Thread.is_alive()
parent
e3517548
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
12 deletions
+12
-12
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+2
-2
src/ZEO/tests/ConnectionTests.py
src/ZEO/tests/ConnectionTests.py
+1
-1
src/ZEO/tests/TestThread.py
src/ZEO/tests/TestThread.py
+1
-1
src/ZEO/tests/ThreadTests.py
src/ZEO/tests/ThreadTests.py
+2
-2
src/ZEO/tests/ZEO4/StorageServer.py
src/ZEO/tests/ZEO4/StorageServer.py
+2
-2
src/ZEO/tests/ZEO4/zrpc/client.py
src/ZEO/tests/ZEO4/zrpc/client.py
+2
-2
src/ZEO/tests/testConnection.py
src/ZEO/tests/testConnection.py
+1
-1
src/ZEO/tests/zeo_blob_cache.test
src/ZEO/tests/zeo_blob_cache.test
+1
-1
No files found.
src/ZEO/StorageServer.py
View file @
c5273402
...
@@ -939,7 +939,7 @@ class StorageServer(object):
...
@@ -939,7 +939,7 @@ class StorageServer(object):
status
[
'connections'
]
=
len
(
status
[
'connections'
])
status
[
'connections'
]
=
len
(
status
[
'connections'
])
lock_manager
=
self
.
lock_managers
[
storage_id
]
lock_manager
=
self
.
lock_managers
[
storage_id
]
status
[
'waiting'
]
=
len
(
lock_manager
.
waiting
)
status
[
'waiting'
]
=
len
(
lock_manager
.
waiting
)
status
[
'timeout-thread-is-alive'
]
=
lock_manager
.
timeout
.
is
A
live
()
status
[
'timeout-thread-is-alive'
]
=
lock_manager
.
timeout
.
is
_a
live
()
last_transaction
=
self
.
storages
[
storage_id
].
lastTransaction
()
last_transaction
=
self
.
storages
[
storage_id
].
lastTransaction
()
last_transaction_hex
=
codecs
.
encode
(
last_transaction
,
'hex_codec'
)
last_transaction_hex
=
codecs
.
encode
(
last_transaction
,
'hex_codec'
)
if
PY3
:
if
PY3
:
...
@@ -960,7 +960,7 @@ class StubTimeoutThread(object):
...
@@ -960,7 +960,7 @@ class StubTimeoutThread(object):
def
end
(
self
,
client
):
def
end
(
self
,
client
):
pass
pass
is
A
live
=
lambda
self
:
'stub'
is
_a
live
=
lambda
self
:
'stub'
class
TimeoutThread
(
threading
.
Thread
):
class
TimeoutThread
(
threading
.
Thread
):
...
...
src/ZEO/tests/ConnectionTests.py
View file @
c5273402
...
@@ -493,7 +493,7 @@ class ConnectionTests(CommonSetupTearDown):
...
@@ -493,7 +493,7 @@ class ConnectionTests(CommonSetupTearDown):
# Wait for all threads to finish
# Wait for all threads to finish
for
t
in
threads
:
for
t
in
threads
:
t
.
join
(
60
)
t
.
join
(
60
)
self
.
assertFalse
(
t
.
is
A
live
(),
"%s didn't die"
%
t
.
getName
())
self
.
assertFalse
(
t
.
is
_a
live
(),
"%s didn't die"
%
t
.
getName
())
finally
:
finally
:
for
t
in
threads
:
for
t
in
threads
:
t
.
closeclients
()
t
.
closeclients
()
...
...
src/ZEO/tests/TestThread.py
View file @
c5273402
...
@@ -53,5 +53,5 @@ class TestThread(threading.Thread):
...
@@ -53,5 +53,5 @@ class TestThread(threading.Thread):
self
.
join
(
timeout
)
self
.
join
(
timeout
)
if
self
.
_exc_info
:
if
self
.
_exc_info
:
six
.
reraise
(
self
.
_exc_info
[
0
],
self
.
_exc_info
[
1
],
self
.
_exc_info
[
2
])
six
.
reraise
(
self
.
_exc_info
[
0
],
self
.
_exc_info
[
1
],
self
.
_exc_info
[
2
])
if
self
.
is
A
live
():
if
self
.
is
_a
live
():
self
.
_testcase
.
fail
(
"Thread did not finish: %s"
%
self
)
self
.
_testcase
.
fail
(
"Thread did not finish: %s"
%
self
)
src/ZEO/tests/ThreadTests.py
View file @
c5273402
...
@@ -34,7 +34,7 @@ class BasicThread(threading.Thread):
...
@@ -34,7 +34,7 @@ class BasicThread(threading.Thread):
def
join
(
self
):
def
join
(
self
):
threading
.
Thread
.
join
(
self
,
10
)
threading
.
Thread
.
join
(
self
,
10
)
assert
not
self
.
is
A
live
()
assert
not
self
.
is
_a
live
()
class
GetsThroughVoteThread
(
BasicThread
):
class
GetsThroughVoteThread
(
BasicThread
):
...
@@ -119,7 +119,7 @@ class ThreadTests(object):
...
@@ -119,7 +119,7 @@ class ThreadTests(object):
for
t
in
threads
:
for
t
in
threads
:
t
.
join
(
30
)
t
.
join
(
30
)
for
i
in
threads
:
for
i
in
threads
:
self
.
assertFalse
(
t
.
is
A
live
())
self
.
assertFalse
(
t
.
is
_a
live
())
# Helper for checkMTStores
# Helper for checkMTStores
def
mtstorehelper
(
self
):
def
mtstorehelper
(
self
):
...
...
src/ZEO/tests/ZEO4/StorageServer.py
View file @
c5273402
...
@@ -1307,7 +1307,7 @@ class StorageServer(object):
...
@@ -1307,7 +1307,7 @@ class StorageServer(object):
status
=
self
.
stats
[
storage_id
].
__dict__
.
copy
()
status
=
self
.
stats
[
storage_id
].
__dict__
.
copy
()
status
[
'connections'
]
=
len
(
status
[
'connections'
])
status
[
'connections'
]
=
len
(
status
[
'connections'
])
status
[
'waiting'
]
=
len
(
self
.
_waiting
[
storage_id
])
status
[
'waiting'
]
=
len
(
self
.
_waiting
[
storage_id
])
status
[
'timeout-thread-is-alive'
]
=
self
.
timeouts
[
storage_id
].
is
A
live
()
status
[
'timeout-thread-is-alive'
]
=
self
.
timeouts
[
storage_id
].
is
_a
live
()
last_transaction
=
self
.
storages
[
storage_id
].
lastTransaction
()
last_transaction
=
self
.
storages
[
storage_id
].
lastTransaction
()
last_transaction_hex
=
codecs
.
encode
(
last_transaction
,
'hex_codec'
)
last_transaction_hex
=
codecs
.
encode
(
last_transaction
,
'hex_codec'
)
if
PY3
:
if
PY3
:
...
@@ -1336,7 +1336,7 @@ class StubTimeoutThread(object):
...
@@ -1336,7 +1336,7 @@ class StubTimeoutThread(object):
def
end
(
self
,
client
):
def
end
(
self
,
client
):
pass
pass
is
A
live
=
lambda
self
:
'stub'
is
_a
live
=
lambda
self
:
'stub'
class
TimeoutThread
(
threading
.
Thread
):
class
TimeoutThread
(
threading
.
Thread
):
...
...
src/ZEO/tests/ZEO4/zrpc/client.py
View file @
c5273402
...
@@ -218,7 +218,7 @@ class ConnectionManager(object):
...
@@ -218,7 +218,7 @@ class ConnectionManager(object):
log
(
"CM.close(): stopping and joining thread"
)
log
(
"CM.close(): stopping and joining thread"
)
t
.
stop
()
t
.
stop
()
t
.
join
(
30
)
t
.
join
(
30
)
if
t
.
is
A
live
():
if
t
.
is
_a
live
():
log
(
"CM.close(): self.thread.join() timed out"
,
log
(
"CM.close(): self.thread.join() timed out"
,
level
=
logging
.
WARNING
)
level
=
logging
.
WARNING
)
...
@@ -288,7 +288,7 @@ class ConnectionManager(object):
...
@@ -288,7 +288,7 @@ class ConnectionManager(object):
t
.
setDaemon
(
1
)
t
.
setDaemon
(
1
)
t
.
start
()
t
.
start
()
if
sync
:
if
sync
:
while
self
.
connection
is
None
and
t
.
is
A
live
():
while
self
.
connection
is
None
and
t
.
is
_a
live
():
self
.
cond
.
wait
(
self
.
sync_wait
)
self
.
cond
.
wait
(
self
.
sync_wait
)
if
self
.
connection
is
None
:
if
self
.
connection
is
None
:
log
(
"CM.connect(sync=1): still waiting..."
)
log
(
"CM.connect(sync=1): still waiting..."
)
...
...
src/ZEO/tests/testConnection.py
View file @
c5273402
...
@@ -213,7 +213,7 @@ This tests tries to provoke this bug by:
...
@@ -213,7 +213,7 @@ This tests tries to provoke this bug by:
... stop = True
... stop = True
... thread.join(10)
... thread.join(10)
>>> thread.is
A
live()
>>> thread.is
_a
live()
False
False
>>> for record in handler.records:
>>> for record in handler.records:
...
...
src/ZEO/tests/zeo_blob_cache.test
View file @
c5273402
...
@@ -136,7 +136,7 @@ provoke problems:
...
@@ -136,7 +136,7 @@ provoke problems:
...
thread
.
start
()
...
thread
.
start
()
>>>
for
thread
in
threads
:
>>>
for
thread
in
threads
:
...
thread
.
join
(
99
)
...
thread
.
join
(
99
)
...
if
thread
.
is
A
live
()
:
...
if
thread
.
is
_a
live
()
:
...
print
(
"Can't join thread."
)
...
print
(
"Can't join thread."
)
>>>
wait_until
(
"size is reduced"
,
check
,
99
,
onfail
)
>>>
wait_until
(
"size is reduced"
,
check
,
99
,
onfail
)
...
...
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