log4mongo / log4mongo-python

python logging handler for mongo database
http://log4mongo.org
Other
111 stars 37 forks source link

Should I set reuse=False when pymongo's fork unsafety is concerned? #37

Open tarjintor opened 6 years ago

tarjintor commented 6 years ago

I use log4mongo with celery, celery is in prefork model. Then every process use the same MongoHandler,since I import it bofore fork happened. if I don't set reuse=False, there is a warning from pymongo for there are multil processes share the same mongo client, as https://api.mongodb.com/python/current/faq.html says,it's not fork safe. So, should I set reuse=False when prefork is used?