-
Type: Bug
-
Resolution: Fixed
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: Connection Mgmt
-
None
-
Environment:CPython 2.7, gevent
When using pymongo inside greenlets with gevent.monkey.patch_all like so:
from gevent.monkey import patch_all patch_all() from gevent import spawn from pymongo import MongoClient client = MongoClient() def poller(): while True: client.db.test_col.insert({'foo': 'bar'}) def main(): task = spawn(poller) task.kill() assert task.dead
There is a possibility of poller will not be killed, as GreenletExit will be eaten here: https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/network.py#L234