-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.0, 3.0.1, 3.0.2
-
Component/s: None
-
None
You can see this running the unit tests locally. The test suite hangs for some time before completing. This is also causing confusion in the community, with users assuming PyMongo 3 is "slow" for certain styles of benchmarks. For example:
http://stackoverflow.com/questions/30334438/pymongo-3-0-2-slower-than-2-8-1/30338779#30338779
The problem appears to be in periodic_executor.py. When the close() method is called self._stop is set to True but there is no call to wake(). This means the thread blocks for up to 10 seconds before waking and terminating.
https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/periodic_executor.py#L75