Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PeterTonoli opened this issue May 17, 2018 · 1 comment
Open

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

PeterTonoli opened this issue May 17, 2018 · 1 comment

Comments

@PeterTonoli
Copy link
Contributor

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
Copy link
Contributor

czk2010 commented May 23, 2018

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 -->

j = multiprocessing.Process(target=self.build_graph, args=(self.graph_type, datafiles, total))

and may be the cause of apparent hangs when processing large xml sets. The mongo connection should done inside the subprocess. requires some refactoring...

PeterTonoli added a commit that referenced this issue Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants