zeopack.py / ClientStorage.py: deadlock on non existent storage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
Incomplete
|
Medium
|
Unassigned |
Bug Description
Hello,
I try to pack my storages at zeo with the zeopack.py command per cronjob.
Example:
> zeopack.py -h localhost -S 1 -p 9999 -d 30
If I try inadvertently to pack an non existent storage like "2" for example, the
zeopack.py doesn't return an error. Instead of returning an error, it retries to connect the storage over and over again. The script has to be stopped manually. This effect isn't very practical for cron jobs.
Debug results:
> ./zeopack.py -h localhost -S 2 -p 9999 -d 30
------
2005-03-24T11:37:23 INFO(0) ZCS:22023 ClientStorage (pid=22023) created RO/normal for storage: '2'
------
2005-03-24T11:37:23 INFO(0) ZEC:2-None-0 ClientCache: storage='2', size=20971520; file[0]='2-None-0'
------
2005-03-24T11:37:23 INFO(0) ZCS:22023 Testing connection <ManagedConnection ('192.168.3.197', 9999)>
------
2005-03-24T11:37:23 INFO(0) zrpc-conn:
------
2005-03-24T11:37:23 INFO(0) ZCS:22023 Server authentication protocol None
------
2005-03-24T11:37:23 ERROR(200) zrpc:22023 CW: error in testConnection (('localhost', 9999))
Traceback (most recent call last):
File "/usr/lib/
self.preferred = self.client.
File "/usr/lib/
stub.
File "/usr/lib/
self.
File "/usr/lib/
raise inst # error raised by server
ValueError: unknown storage: 2
Solution:
The testConnection routine of ClientStorage class should also consider the
"ValueError: unknown storage" to break the deadlock.
Best regards
A. Gabriel
affects: | zope2 → zodb |
Changed in zodb: | |
importance: | Low → Medium |
Changed in ubuntu: | |
status: | New → Incomplete |
Changed in zodb: | |
assignee: | nobody → Kadir Selçuk (turkdevops) |
Changed in ubuntu: | |
assignee: | nobody → Kadir Selçuk (turkdevops) |
status: | Incomplete → Fix Committed |
Changed in zodb: | |
assignee: | Kadir Selçuk (turkdevops) → nobody |
Changed in ubuntu: | |
assignee: | Kadir Selçuk (turkdevops) → nobody |
Changed in zodb: | |
status: | New → Incomplete |
Changed in ubuntu: | |
status: | Fix Committed → Incomplete |
no longer affects: | ubuntu |
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.