[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - trigger.py:1.14.20.1

Tim Peters tim at zope.com
Wed Oct 1 10:48:28 EDT 2003


[Jeremy Hylton]
>> Modified Files:
>>       Tag: Zope-2_7-branch
>> 	trigger.py
>> Log Message:
>> Untested, potentially leak-free close() method for Windows.

> I tested this code on Win2k and it didn't cause tests to fail.  I
> don't know if it fixed the leak, but I expect that it did.

I'm in FB today and don't have a Win98 box.  Here's the original test
driver:

"""
import ZODB
from ZODB import DB
from ZEO import ClientStorage

i = 0
while 1:
    storage = ClientStorage.ClientStorage(('localhost', 9992))
    db = DB(storage)
    conn = db.open()
    root = conn.root()
    root['key'] = i
    i += 1
    get_transaction().commit()
    print i,
    conn.close()
    db.close()
    storage.close()
"""

Before your patch, the client died on Win2K after 506 iterations, with a
Mystery Error:

Traceback (most recent call last):
  File "thec.py", line 13, in ?
    get_transaction().commit()
  File "C:\Code\ZODB3-3_2-branch\ZODB\Transaction.py", line 232, in commit
    self._commit_begin(jars, subjars, subtransaction)
  File "C:\Code\ZODB3-3_2-branch\ZODB\Transaction.py", line 340, in
_commit_begin
    jar.tpc_begin(self)
  File "C:\Code\ZODB3-3_2-branch\ZODB\Connection.py", line 689, in tpc_begin
    self._storage.tpc_begin(transaction)
  File "C:\Code\ZODB3-3_2-branch\ZEO\ClientStorage.py", line 854, in
tpc_begin
    txn._extension, tid, status)
  File "C:\Code\ZODB3-3_2-branch\ZEO\ServerStub.py", line 84, in tpc_begin
    return self.rpc.call('tpc_begin', id, user, descr, ext, tid, status)
  File "C:\Code\ZODB3-3_2-branch\ZEO\zrpc\connection.py", line 368, in call
    raise inst # error raised by server
OSError: (0, 'Error')

After the patch, it's run 3000 iterations so far w/o incident.

So I expect the server is no longer leaking open sockets.

However,

1) I expect the server has been leaking trigger instances all along,
   else the previously-leaking open "w" socket would have been closed
   by magic all along.

2) After the patch, the client leaks about 200KB of memory per second,
   and the server leaks about 100KB/sec, on my otherwise-quiet Win2K
   box here.  That's pretty dramatic growth given how little the
   driver does per iteration, and that it only does about 5 iterations
   per second on Win2K.




More information about the Zodb-checkins mailing list