twisted / txmongo

asynchronous python driver for mongo
https://txmongo.readthedocs.io
Apache License 2.0
338 stars 102 forks source link

Fixing KeyError when bulk operation is interrupted (for example by failover) #231

Closed IlyaSkriblovsky closed 6 years ago

IlyaSkriblovsky commented 6 years ago

If Bulk operation is interrupted (by failover, by network failure, ...) current version of txmongo with combination of PyMongo 3.6.0 raises KeyError from coll.bulk_write. This is because we are calling pymongo.bulk._merge_command without checking it for being proper bulk response.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.005%) to 95.2% when pulling 49914476f1fc687ebb3602358d2af7550e7c99bc on IlyaSkriblovsky:pymongo3.6-bulk-operationfailure into 3bdd644c440ba1c662a40c624818ea88b2d1c804 on twisted:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.005%) to 95.2% when pulling 773b9637981f8d4ef604a1a23b905c77c74bd856 on IlyaSkriblovsky:pymongo3.6-bulk-operationfailure into 3bdd644c440ba1c662a40c624818ea88b2d1c804 on twisted:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.005%) to 95.2% when pulling 773b9637981f8d4ef604a1a23b905c77c74bd856 on IlyaSkriblovsky:pymongo3.6-bulk-operationfailure into 3bdd644c440ba1c662a40c624818ea88b2d1c804 on twisted:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.005%) to 95.2% when pulling 773b9637981f8d4ef604a1a23b905c77c74bd856 on IlyaSkriblovsky:pymongo3.6-bulk-operationfailure into 3bdd644c440ba1c662a40c624818ea88b2d1c804 on twisted:master.

psi29a commented 6 years ago

We'll eventually have to implement sessions. :/

IlyaSkriblovsky commented 6 years ago

Yep, it would be cool

psi29a commented 6 years ago

Great, just an update in the change log and we're good to go.