How do I disconnect a gcouchbase.bucket.Bucket


#1

Now I got an error like:

site-packages/gcouchbase/iops_gevent10.py", line 86, in timer_event_factory return GEventTimer() TypeError: 'NoneType' object is not callable

I suspect it is related to disconnect.


#2

I’d be interested in reproducing this error. Can you show me the script which caused this? Also, ensure you are running on the latest version of the Python SDK (2.0.7). This fix may be relevant (and is in 2.0.7): https://github.com/couchbase/couchbase-python-client/commit/a10df216239424e129e30ce4401fc011d6097a2d

Also, it seems you’re using the deprecated 0.x version of gevent. You may wish to upgrade to the 1.x series.


#3

Thank you for the quick reply. Pretty hard to reproduce. A simple script works well, but somehow not when mixed in a larger project. From your reply and documents, also I haven’t read it, but looks I don’t need to explicitly call “disconnect” or “close” somehow, am I right?

Thanks!


#4

Yes, it should normally be sufficient to simply let the Bucket object fall out of reference. In practice however you may have situations where you have things like circular references which would prevent the Bucket from actually being destroyed. Let me know if you’re running into this.