[ZODB-Dev] ZEO packing

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 19 Sep 2002 08:27:32 +0100


On Wednesday 18 Sep 2002 12:44 pm, Toby Dickenson wrote:
> A few weeks ago Jeremy added SlowMethodThread handling to the ZEO 2
> StorageServer so that potentially long undo operations dont block other=
 ZEO
> clients. This is *very* nice.
>
> This new mechanism has also been used for handling pack, which has caus=
ed a
> change in behavior that I was not expecting. Previously ZEO clients wou=
ld
> see the pack method return immediately, and the ZEO server ran the pack
> asynchronously. Today the packing will block that ZEO client, the same =
as
> if there was no ZEO between the client and the underlying storage.
>
> I think this new behaviour is better, but I guess it could cause a prob=
lem
> if you are not expecting it.
>

Eeek! it looks like this change may have been accidental. In ClientStorag=
e.py:=20

    def pack(self, t=3DNone, rf=3DNone, wait=3D0, days=3D0):
        ....

"wait=3D0" suggest that the default was intended to be not waiting, the s=
ame as=20
ZEO1, but in StorageServer.py

    def pack(self, time, wait=3DNone):
        if wait is not None:
            ....

I propose changing StorageServer to check "if wait:" rather than
"if wait is not None:" so that passing wait=3D0 has the expected effect. =
Do we=20
want the default to be blocking or non-blocking?