-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6
-
Component/s: None
-
None
If MongoClient and MongoReplicaSetClient are initialized with _connect=False and many threads attempt inserts at once, some may receive a TypeError:
File "/Users/emptysquare/.virtualenvs/official/mongo-python-driver/pymongo/collection.py", line 362, in insert
self.database.connection)
TypeError: an integer is required
Alternatively, MongoReplicaSetClient may throw InvalidOperation instead:
File "/Users/emptysquare/.virtualenvs/official/mongo-python-driver/pymongo/collection.py", line 347, in insert self.database.connection._ensure_connected(True) File "/Users/emptysquare/.virtualenvs/official/mongo-python-driver/pymongo/mongo_replica_set_client.py", line 1243, in _ensure_connected self.__schedule_refresh(sync) File "/Users/emptysquare/.virtualenvs/official/mongo-python-driver/pymongo/mongo_replica_set_client.py", line 1067, in __schedule_refresh self.__monitor.schedule_refresh() File "/Users/emptysquare/.virtualenvs/official/mongo-python-driver/pymongo/mongo_replica_set_client.py", line 295, in schedule_refresh "Monitor thread is dead: Perhaps started before a fork?") InvalidOperation: Monitor thread is dead: Perhaps started before a fork?
These bugs are a consequence of PYTHON-516, which made _connect=False work more correctly than before, and related to PYTHON-414 which requires a client to be connected before using the max_message_size attribute in insert().
- related to
-
PYTHON-652 the connected server supports BSON document sizes up to 0 bytes!!
- Closed