Commit 87a90e41 authored by Jeremy Hylton's avatar Jeremy Hylton

In the test cose, call close_server() instead of just close the

storage.  This provides a minimal test of the server close
functionality.
parent 30cbe056
master incremental-recovery verify-on-recovery 5.5.1 5.5.0 5.4.0 5.3.0 5.2.4 5.2.3 5.2.2 5.2.1 5.2.0 5.1.1 5.1.0 5.0.1 5.0.0 5.0.0b1 5.0.0a6 5.0.0a5 5.0.0a4 5.0.0a3 5.0.0a2 5.0.0a1 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.1 4.3.0 4.2.0 4.2.0b1 4.1.0 4.0.1 4.0.0 4.0.0b3 4.0.0b2 4.0.0b1 4.0.0a4 4.0.0a3 4.0.0a2 4.0.0a1 3.10.7 3.10.6 3.10.5 3.10.3 3.10.2 3.10.1 3.10.0 3.10.0b8 3.10.0b7 3.10.0b6 3.10.0b5 3.10.0b4 3.10.0b3 3.10.0b2 3.10.0b1 3.10.0a2 3.10.0a1 3.9.7 3.9.6 3.9.5 3.9.4 3.9.3 3.9.2 3.9.1 3.9.0 3.9.0c3 3.9.0c2 3.9.0c1 3.9.0b5 3.9.0b4 3.9.0b3 3.9.0b2 3.9.0b1 3.9.0a12 3.9.0a11 3.9.0a10 3.9.0a9 3.9.0a8 3.9.0a7 3.9.0a6 3.9.0a5 3.9.0a4 3.9.0a3 3.9.0a2 3.9.0a1 3.8.6 3.8.5 3.8.4 3.8.3 3.8.3b1 3.8.2 3.8.1 3.8.1b9 3.8.1b8 3.8.1b7 3.8.1b6 3.8.1b5 3.8.1b4 3.8.1b3 3.8.1b2 3.8.1b1 3.8.0 3.8.0c1 3.8.0b5 3.8.0b4 3.8.0b3 3.8.0b1 3.7.4 3.7.3 3.7.2 3.7.1 3.7.0 3.7.0b2 3.7.0b1 3.7-Zope-3.3.0rc1 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.6.0 3.6.0b6 3.6.0b5 3.6.0b4 3.6.0b3 3.6.0b2 3.6.0b1 3.6.0a4 3.6.0a3 3.6.0a2 3.6.0a1 3.5.1 3.5.1b2 3.5.1b1 3.5.0 3.5.0a8 3.5.0a7 3.5.0a6 3.5.0a5 3.5.0a4 3.5.0a3 3.5.0a2 3.5.0a1 3.4.6 3.4.5 3.4.4 3.4.3 3.4.2 3.4.2b3 3.4.2b2 3.4.2b1 3.4.1 3.4.1b5 3.4.1b4 3.4.1b3 3.4.1b2 3.4.1b1 3.4.1a6 3.4.1a5 3.4.1a4 3.4.1a3 3.4.1a2 3.4.1a1 3.4.0 3.4.0c2 3.4.0c1 3.4.0b3 3.4.0b2 3.4.0a9 3.4.0a8 3.4.0a7 3.4.0a6 3.4.0a5 3.4.0a4 3.4.0a3 3.4.0a2.1 3.4.0a2 3.4.0a1 3.3.1 3.3.1c1 3.3.1a1 3.3.0 3.3.0c1 3.3.0b2 3.3.0b1 3.3.0a2 new-doc cvs-to-svn-conversion blob-technical-preview before_transaction_remove
No related merge requests found
......@@ -68,9 +68,9 @@ class ZEOTestServer(asyncore.dispatcher):
"""
__super_init = asyncore.dispatcher.__init__
def __init__(self, addr, storage, keep):
def __init__(self, addr, server, keep):
self.__super_init()
self._storage = storage
self._server = server
self._keep = keep
# Count down to zero, the number of connects
self._count = 1
......@@ -96,13 +96,14 @@ class ZEOTestServer(asyncore.dispatcher):
def handle_accept(self):
sock, addr = self.accept()
self.log('in handle_accept()')
# When we're done with everything, close the storage. Do not write
# the ack character until the storage is finished closing.
# When we're done with everything, close the server. Do not write
# the ack character until the server is finished closing.
if self._count <= 0:
self.log('closing the storage')
self._storage.close()
self.log('closing the server')
self._server.close_server()
if not self._keep:
cleanup(self._storage)
for storage in self._server.storages.values():
cleanup(storage)
self.log('exiting')
os._exit(0)
self.log('continuing')
......@@ -157,21 +158,21 @@ def main():
zeo_port = int(args[0])
test_port = zeo_port + 1
test_addr = ('', test_port)
addr = ('', zeo_port)
log(label, 'creating the storage server')
serv = ZEO.StorageServer.StorageServer(
addr, {'1': storage}, ro_svr,
invalidation_queue_size=invalidation_queue_size,
transaction_timeout=transaction_timeout)
try:
log(label, 'creating the test server, ro: %s, keep: %s', ro_svr, keep)
t = ZEOTestServer(test_addr, storage, keep)
t = ZEOTestServer(test_addr, serv, keep)
except socket.error, e:
if e[0] <> errno.EADDRINUSE: raise
log(label, 'addr in use, closing and exiting')
storage.close()
cleanup(storage)
sys.exit(2)
addr = ('', zeo_port)
log(label, 'creating the storage server')
serv = ZEO.StorageServer.StorageServer(
addr, {'1': storage}, ro_svr,
invalidation_queue_size=invalidation_queue_size,
transaction_timeout=transaction_timeout)
# Create daemon suicide thread
d = Suicide(test_addr)
d.setDaemon(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment