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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
ff92d8be
Commit
ff92d8be
authored
Feb 01, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The storage server is now multi-threaded.
parent
da5312e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
src/ZEO/StorageServer.py
src/ZEO/StorageServer.py
+4
-4
src/ZEO/zrpc/connection.py
src/ZEO/zrpc/connection.py
+15
-9
No files found.
src/ZEO/StorageServer.py
View file @
ff92d8be
...
@@ -1346,7 +1346,7 @@ class ClientStub:
...
@@ -1346,7 +1346,7 @@ class ClientStub:
self
.
rpc
.
callAsync
(
'endVerify'
)
self
.
rpc
.
callAsync
(
'endVerify'
)
def
invalidateTransaction
(
self
,
tid
,
args
):
def
invalidateTransaction
(
self
,
tid
,
args
):
self
.
rpc
.
callAsync
NoPoll
(
'invalidateTransaction'
,
tid
,
args
)
self
.
rpc
.
callAsync
(
'invalidateTransaction'
,
tid
,
args
)
def
serialnos
(
self
,
arg
):
def
serialnos
(
self
,
arg
):
self
.
rpc
.
callAsyncNoPoll
(
'serialnos'
,
arg
)
self
.
rpc
.
callAsyncNoPoll
(
'serialnos'
,
arg
)
...
@@ -1372,11 +1372,11 @@ class ClientStub:
...
@@ -1372,11 +1372,11 @@ class ClientStub:
class
ClientStub308
(
ClientStub
):
class
ClientStub308
(
ClientStub
):
def
invalidateTransaction
(
self
,
tid
,
args
):
def
invalidateTransaction
(
self
,
tid
,
args
):
self
.
rpc
.
callAsyncNoPoll
(
ClientStub
.
invalidateTransaction
(
'invalidateTransaction'
,
tid
,
[(
arg
,
''
)
for
arg
in
args
])
self
,
tid
,
[(
arg
,
''
)
for
arg
in
args
])
def
invalidateVerify
(
self
,
oid
):
def
invalidateVerify
(
self
,
oid
):
self
.
rpc
.
callAsync
(
'invalidateVerify'
,
(
oid
,
''
))
ClientStub
.
invalidateVerify
(
self
,
(
oid
,
''
))
class
ZEOStorage308Adapter
:
class
ZEOStorage308Adapter
:
...
...
src/ZEO/zrpc/connection.py
View file @
ff92d8be
...
@@ -560,14 +560,17 @@ class ManagedServerConnection(Connection):
...
@@ -560,14 +560,17 @@ class ManagedServerConnection(Connection):
# Exception types that should not be logged:
# Exception types that should not be logged:
unlogged_exception_types
=
(
ZODB
.
POSException
.
POSKeyError
,
)
unlogged_exception_types
=
(
ZODB
.
POSException
.
POSKeyError
,
)
# Servers use a shared server trigger that uses the asyncore socket map
trigger
=
ZEO
.
zrpc
.
trigger
.
trigger
()
call_from_thread
=
trigger
.
pull_trigger
def
__init__
(
self
,
sock
,
addr
,
obj
,
mgr
):
def
__init__
(
self
,
sock
,
addr
,
obj
,
mgr
):
self
.
mgr
=
mgr
self
.
mgr
=
mgr
Connection
.
__init__
(
self
,
sock
,
addr
,
obj
,
'S'
)
map
=
{}
Connection
.
__init__
(
self
,
sock
,
addr
,
obj
,
'S'
,
map
=
map
)
self
.
marshal
=
ServerMarshaller
()
self
.
marshal
=
ServerMarshaller
()
self
.
trigger
=
ZEO
.
zrpc
.
trigger
.
trigger
(
map
)
self
.
call_from_thread
=
self
.
trigger
.
pull_trigger
t
=
threading
.
Thread
(
target
=
server_loop
,
args
=
(
map
,))
t
.
setDaemon
(
True
)
t
.
start
()
def
handshake
(
self
):
def
handshake
(
self
):
# Send the server's preferred protocol to the client.
# Send the server's preferred protocol to the client.
...
@@ -601,6 +604,13 @@ class ManagedServerConnection(Connection):
...
@@ -601,6 +604,13 @@ class ManagedServerConnection(Connection):
poll
=
smac
.
SizedMessageAsyncConnection
.
handle_write
poll
=
smac
.
SizedMessageAsyncConnection
.
handle_write
def
server_loop
(
map
):
while
len
(
map
)
>
1
:
asyncore
.
poll
(
30.0
,
map
)
for
o
in
map
.
values
():
o
.
close
()
class
ManagedClientConnection
(
Connection
):
class
ManagedClientConnection
(
Connection
):
"""Client-side Connection subclass."""
"""Client-side Connection subclass."""
__super_init
=
Connection
.
__init__
__super_init
=
Connection
.
__init__
...
@@ -714,10 +724,6 @@ class ManagedClientConnection(Connection):
...
@@ -714,10 +724,6 @@ class ManagedClientConnection(Connection):
self
.
trigger
.
pull_trigger
()
self
.
trigger
.
pull_trigger
()
# Delay used when we call asyncore.poll() directly.
# Start with a 1 msec delay, double until 1 sec.
delay
=
0.001
self
.
replies_cond
.
acquire
()
self
.
replies_cond
.
acquire
()
try
:
try
:
while
1
:
while
1
:
...
...
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