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
Kirill Smelkov
ZODB
Commits
cfe16277
Commit
cfe16277
authored
May 04, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix:
https://bugs.launchpad.net/zodb/+bug/135108
parent
10bf4413
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
2 deletions
+58
-2
src/CHANGES.txt
src/CHANGES.txt
+9
-0
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+28
-0
src/ZEO/zrpc/server.py
src/ZEO/zrpc/server.py
+21
-2
No files found.
src/CHANGES.txt
View file @
cfe16277
...
...
@@ -62,6 +62,15 @@ Bugs Fixed
- Fixed some problems in ZEO server commit lock management.
- On Mac OS X, clients that connected and disconnected quickly could
cause a ZEO server to stop accepting connections, due to a failure
to catch errors in the initial part of the connection process.
The failure to properly handle exceptions while accepting
connections is potentially problematic on other platforms.
Fixes: https://bugs.launchpad.net/zodb/+bug/135108
3.10.0a1 (2010-02-08)
=====================
...
...
src/ZEO/tests/testZEO.py
View file @
cfe16277
...
...
@@ -1338,6 +1338,34 @@ else:
class
MultiprocessingTests
(
unittest
.
TestCase
):
pass
def
quick_close_doesnt_kill_server
():
r"""
Start a server:
>>> addr, _ = start_server()
Now connect and immediately disconnect. This caused the server to
die in the past:
>>> import socket, struct
>>> for i in range(5):
... s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
... s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
... struct.pack('ii', 1, 0))
... s.connect(addr)
... s.close()
Now we should be able to connect as normal:
>>> db = ZEO.DB(addr)
>>> db.storage.is_connected()
True
>>> db.close()
"""
slow_test_classes
=
[
BlobAdaptedFileStorageTests
,
BlobWritableCacheTests
,
DemoStorageTests
,
FileStorageTests
,
MappingStorageTests
,
...
...
src/ZEO/zrpc/server.py
View file @
cfe16277
...
...
@@ -17,6 +17,7 @@ import types
from
ZEO.zrpc.connection
import
Connection
from
ZEO.zrpc.log
import
log
import
ZEO.zrpc.log
import
logging
# Export the main asyncore loop
...
...
@@ -54,5 +55,23 @@ class Dispatcher(asyncore.dispatcher):
except
socket
.
error
,
msg
:
log
(
"accepted failed: %s"
%
msg
)
return
c
=
self
.
factory
(
sock
,
addr
)
log
(
"connect from %s: %s"
%
(
repr
(
addr
),
c
))
# We could short-circuit the attempt below in some edge cases
# and avoid a log message by checking for addr being None.
# Unfortunately, our test for the code below,
# quick_close_doesnt_kill_server, causes addr to be None and
# we'd have to write a test for the non-None case, which is
# *even* harder to provoke. :/ So we'll leave things as they
# are for now.
# It might be better to check whether the socket has been
# closed, but I don't see a way to do that. :(
try
:
c
=
self
.
factory
(
sock
,
addr
)
except
:
if
sock
.
fileno
()
in
asyncore
.
socket_map
:
del
asyncore
.
socket_map
[
sock
.
fileno
()]
ZEO
.
zrpc
.
log
.
logger
.
exception
(
"Error in handle_accept"
)
else
:
log
(
"connect from %s: %s"
%
(
repr
(
addr
),
c
))
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