I'm trying to make zeopack fail without hanging when faced by a ZEO server it can't talk to.
I set wait_timeout in the pack2 function in zeopack.py:
cs = ClientStorage(addr, storage=storage, wait=1, wait_timeout=3, read_only=1)
However, this has no effect because in ClientStorage._wait, the call to 'self._rpc_mgr.connect(sync=1)' hangs before the timeout 'while' loop is entered.
I'm looking at
Zope-2.10.5-final/lib/python/ZEO/ClientStorage.py
but the code is the same in Zope-2.11.3-final
This is what a failing zeopack run looks like:
zope@redacted:/home/zope/instances/plone-2.5/client2$
PYTHONPATH=/home/zope/Zope-2.10.5-final/lib/python/
/home/zope/Zope-2.10.5-final/bin/zeopack.py -p 9030 -S 1
ERROR:ZEO.zrpc.Connection(C):(redacted:9030) bad handshake 'Z201'
ERROR:ZEO.zrpc.Connection(C):(redacted:9030) Error caught in asyncore
Traceback (most recent call last):
File "/home/zope/Python-2.4.4/lib/python2.4/asyncore.py", line 69, in read
obj.handle_read_event()
File "/home/zope/Python-2.4.4/lib/python2.4/asyncore.py", line 391, in handle_read_event
self.handle_read()
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/zrpc/smac.py", line 219, in handle_read
self.message_input(msg)
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/zrpc/connection.py", line 903, in recv_handshake
Connection.recv_handshake(self, proto)
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/zrpc/connection.py", line 489, in recv_handshake
raise ZRPCError("bad handshake %r" % proto)
ZRPCError: bad handshake 'Z201'
ERROR:ZEO.zrpc:(23263) CW: error in testConnection (('redacted', 9030))
Traceback (most recent call last):
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/zrpc/client.py", line 454, in test_connection
self.preferred = self.client.testConnection(self.conn)
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/ClientStorage.py", line 430, in testConnection
auth = stub.getAuthProtocol()
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/ServerStub.py", line 89, in getAuthProtocol
return self.rpc.call('getAuthProtocol')
File "/home/zope/Zope-2.10.5-final/lib/python/ZEO/zrpc/connection.py", line 639, in call
raise DisconnectedError()
DisconnectedError
Here's a different angle on the same issue:
I'm trying to make zeopack fail without hanging when faced by a ZEO server it can't talk to.
I set wait_timeout in the pack2 function in zeopack.py:
cs = ClientStorage(addr, storage=storage, wait=1, wait_timeout=3, read_only=1)
However, this has no effect because in ClientStorage. _wait, the call to 'self._ rpc_mgr. connect( sync=1) ' hangs before the timeout 'while' loop is entered.
I'm looking at 10.5-final/ lib/python/ ZEO/ClientStora ge.py
Zope-2.
but the code is the same in Zope-2.11.3-final
This is what a failing zeopack run looks like:
zope@redacted: /home/zope/ instances/ plone-2. 5/client2$ /home/zope/ Zope-2. 10.5-final/ lib/python/ Zope-2. 10.5-final/ bin/zeopack. py -p 9030 -S 1 zrpc.Connection (C):(redacted: 9030) bad handshake 'Z201' zrpc.Connection (C):(redacted: 9030) Error caught in asyncore zope/Python- 2.4.4/lib/ python2. 4/asyncore. py", line 69, in read handle_ read_event( ) zope/Python- 2.4.4/lib/ python2. 4/asyncore. py", line 391, in handle_read_event handle_ read() zope/Zope- 2.10.5- final/lib/ python/ ZEO/zrpc/ smac.py" , line 219, in handle_read message_ input(msg) zope/Zope- 2.10.5- final/lib/ python/ ZEO/zrpc/ connection. py", line 903, in recv_handshake recv_handshake( self, proto) zope/Zope- 2.10.5- final/lib/ python/ ZEO/zrpc/ connection. py", line 489, in recv_handshake zrpc:(23263) CW: error in testConnection (('redacted', 9030)) zope/Zope- 2.10.5- final/lib/ python/ ZEO/zrpc/ client. py", line 454, in test_connection testConnection( self.conn) zope/Zope- 2.10.5- final/lib/ python/ ZEO/ClientStora ge.py", line 430, in testConnection tocol() zope/Zope- 2.10.5- final/lib/ python/ ZEO/ServerStub. py", line 89, in getAuthProtocol call('getAuthPr otocol' ) zope/Zope- 2.10.5- final/lib/ python/ ZEO/zrpc/ connection. py", line 639, in call
PYTHONPATH=
/home/zope/
ERROR:ZEO.
ERROR:ZEO.
Traceback (most recent call last):
File "/home/
obj.
File "/home/
self.
File "/home/
self.
File "/home/
Connection.
File "/home/
raise ZRPCError("bad handshake %r" % proto)
ZRPCError: bad handshake 'Z201'
ERROR:ZEO.
Traceback (most recent call last):
File "/home/
self.preferred = self.client.
File "/home/
auth = stub.getAuthPro
File "/home/
return self.rpc.
File "/home/
raise DisconnectedError()
DisconnectedError
This loops forever.