esrc-unimelb / CNEX3

The Contextual Network Explorer: A visualisation tool for EAC-CPF files
https://connex.esrc.unimelb.edu.au
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Health-check complaining "MongoClient opened before fork". #2

Open PeterTonoli opened 6 years ago

PeterTonoli commented 6 years ago

INFO [app.Helpers][MainThread] GET /health-check - 192.168.190.23 - check_http/v1.4.16 (nagios-plugins 1.4.16) /usr/local/scholarly-python3/lib/python3.6/site-packages/pymongo/topology.py:149: UserWarning: MongoClient opened before fork. Create MongoClient only after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#is-pymongo-fork-safe "MongoClient opened before fork. Create MongoClient only "

czk2010 commented 6 years ago

this happens on all the endpoints. We are opening a connection to mongo in init prior to kicking of the subprocess(s) handling the requests.

It's potentially a bigger problem here --> https://github.com/esrc-unimelb/CNEX3/blob/867a7a88a0c2b67686e344623a08d204a0bf06a4/service/app/Network.py#L88 and may be the cause of apparent hangs when processing large xml sets. The mongo connection should done inside the subprocess. requires some refactoring...