-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.9
-
Component/s: None
-
None
Since upgrading to pymongo 3.9 we are seeing documents that are failing to insert or update using the following pymongo calls:
coll.update_one(flattened_json_data, {{color:#6a8759}'$set': flattened_json_data}, upsert=True)
coll.find_one_and_update(query, update, upsert=True, projection=projection, return_document=ReturnDocument.AFTER)
However, pymongo seems to be returning successfully even when documents aren't inserted or updated.
We believe this might be due to the fact that we are not using the MongoClient in a fork safe way. We spawn threads and processes that all use the same shared MongoClient connection and sometimes causes the error described here: https://jira.mongodb.org/browse/PYTHON-1992?jql=text%20~%20%22Cannot%20start%20transaction%20on%20session%22
However, is it possible that due to the issues with our application logic's unsafe use of the MongoClient, pymongo could return successfully without having actually successfully completed the insertion/update?
We have since fixed our application logic and have stopped seeing the error described in the linked PBI. We are hoping the issue of failed inserts will be fixed as well.
- related to
-
PYTHON-1660 Driver session pools must be cleared after forking
- Closed