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
94f275c3
Commit
94f275c3
authored
Feb 03, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a threading bug.
parent
434e6938
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+14
-1
src/ZEO/zrpc/connection.py
src/ZEO/zrpc/connection.py
+9
-0
No files found.
src/ZEO/StorageServer.py
View file @
94f275c3
...
...
@@ -1346,7 +1346,20 @@ class ClientStub:
self
.
rpc
.
callAsync
(
'endVerify'
)
def
invalidateTransaction
(
self
,
tid
,
args
):
self
.
rpc
.
callAsync
(
'invalidateTransaction'
,
tid
,
args
)
# Note that this method is *always* called from a different
# thread than self.rpc's async thread. It is the only method
# for which this is true and requires special consideration!
# callAsyncNoSend is important here because:
# - callAsyncNoPoll isn't appropriate because
# the network thread may not wake up for a long time,
# delaying invalidations for too long. (This is demonstrateed
# by a test failure.)
# - callAsync isn't appropriate because (on the server) it tries
# to write to the socket. If self.rpc's network thread also
# tries to write at the ame time, we can run into problems
# because handle_write isn't thread safe.
self
.
rpc
.
callAsyncNoSend
(
'invalidateTransaction'
,
tid
,
args
)
def
serialnos
(
self
,
arg
):
self
.
rpc
.
callAsyncNoPoll
(
'serialnos'
,
arg
)
...
...
src/ZEO/zrpc/connection.py
View file @
94f275c3
...
...
@@ -535,6 +535,15 @@ class Connection(smac.SizedMessageAsyncConnection, object):
raise
DisconnectedError
()
self
.
send_call
(
method
,
args
,
1
)
def
callAsyncNoSend
(
self
,
method
,
*
args
):
# Like CallAsync but doesn't poll. This exists so that we can
# send invalidations atomically to all clients without
# allowing any client to sneak in a load request.
if
self
.
closed
:
raise
DisconnectedError
()
self
.
send_call
(
method
,
args
,
1
)
self
.
call_from_thread
()
def
callAsyncIterator
(
self
,
iterator
):
"""Queue a sequence of calls using an iterator
...
...
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