Commit 1d0f7227 authored by Barry Warsaw's avatar Barry Warsaw

start_zeo_server(): Read 1024 bytes from the initial connection to the

admin address of the subprocess.  Better to gulp 'em now than sip 'em
later.

shutdown_zeo_server(): Same thing here, but notice that on Windows,
the recv() can raise an ECONNRESET, which I believe we can just
ignore.  (Will test this with Tim shortly.)
parent ef3809c2
...@@ -88,7 +88,7 @@ def start_zeo_server(conf, addr=None, ro_svr=0): ...@@ -88,7 +88,7 @@ def start_zeo_server(conf, addr=None, ro_svr=0):
try: try:
zLOG.LOG('forker', zLOG.DEBUG, 'connect %s' % i) zLOG.LOG('forker', zLOG.DEBUG, 'connect %s' % i)
s.connect(adminaddr) s.connect(adminaddr)
ack = s.recv(1) ack = s.recv(1024)
zLOG.LOG('forker', zLOG.DEBUG, 'acked: %s' % ack) zLOG.LOG('forker', zLOG.DEBUG, 'acked: %s' % ack)
break break
except socket.error, e: except socket.error, e:
...@@ -103,6 +103,9 @@ def start_zeo_server(conf, addr=None, ro_svr=0): ...@@ -103,6 +103,9 @@ def start_zeo_server(conf, addr=None, ro_svr=0):
def shutdown_zeo_server(adminaddr): def shutdown_zeo_server(adminaddr):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(adminaddr) s.connect(adminaddr)
ack = s.recv(1) try:
ack = s.recv(1024)
except socket.error, e:
if e[0] <> errno.ECONNRESET: raise
zLOG.LOG('shutdownServer', zLOG.DEBUG, 'acked: %s' % ack) zLOG.LOG('shutdownServer', zLOG.DEBUG, 'acked: %s' % ack)
s.close() s.close()
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