File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,15 @@ PyMongo uses thread and socket functions from the Python standard library.
16
16
Gevent's monkey-patching replaces those standard functions so that PyMongo
17
17
does asynchronous I/O with non-blocking sockets, and schedules operations
18
18
on greenlets instead of threads.
19
+
20
+ Consideration on gevent's hub termination
21
+ -----------------------------------------
22
+ When shutting down your application gracefully, your code be may waiting
23
+ for any remaining greenlet to terminate before exiting.
24
+ Because monkey-patched threads are greenlets and PyMongo uses quite a lot
25
+ of them, this may become a **blocking operation ** and may prevent your
26
+ application to exit properly. You therefore must close (or dereference)
27
+ any active MongoClient object before exiting !
28
+
29
+ **uWSGI ** applications using the ``gevent-wait-for-hub `` option are directly
30
+ affected by this behaviour.
You can’t perform that action at this time.
0 commit comments