Bug 1419679 - UserWarning: MongoClient open before fork.
Summary: UserWarning: MongoClient open before fork.
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.2.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-06 18:01 UTC by Ben
Modified: 2021-04-06 18:00 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-07 16:44:01 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 1655 0 Normal CLOSED - WONTFIX pulp task workers connect to mongo before forking 2019-06-27 12:35:35 UTC
Pulp Redmine 2573 0 Normal CLOSED - WONTFIX UserWarning: MongoClient open before fork 2017-02-07 16:01:31 UTC

Description Ben 2017-02-06 18:01:02 UTC
Description of problem:
Something in pulp is trying to do something with MongoDB with pymongo, and doing it in the wrong order.  Often, after restarting Satellite services ("katello-service restart") you'll see a few of these:

Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792) /usr/lib/python2.7/site-packages/pulp/server/db/model/__init__.py:536: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead.
Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792)   TaskStatus._get_collection().update({'task_id': task_id}, update, upsert=True)
Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792)
Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792) /usr/lib64/python2.7/site-packages/pymongo/topology.py:74: UserWarning: MongoClient opened before fork. Create MongoClient with connect=False, or create client after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#using-pymongo-with-multiprocessing>
Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792)   "MongoClient opened before fork. Create MongoClient "
Feb  6 17:48:50 satellite1 pulp: py.warnings:WARNING: (31295-49792)

I'm told the deprecations are being handled in another BZ, but the UserWarning for pymongo I haven't seen anything about.


Version-Release number of selected component (if applicable):
Satellite 6.2.7 and RHEL7 updated as of 2017-02-06.

How reproducible:
Basically every time you restart Satellite services,

Steps to Reproduce:
1. Restart with "katello-service restart"
2. Wait a bit.
3. Watch /var/log/messages

Actual results:
It's only a warning, but I wouldn't have thought it was something that couldn't be fixed.

Expected results:
No warning, MongoClient.  Perhaps create MongoClient with connect=False, or create client after forking.

Additional info:
None

Comment 1 pulp-infra@redhat.com 2017-02-06 22:31:42 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 2 pulp-infra@redhat.com 2017-02-06 22:31:44 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 3 Ben 2017-02-07 09:52:14 UTC
The version of RHEL is 7.3 (fully updated as of 2017-02-06), if you want to add that to the Pulp Redmine tracker.

Comment 4 pulp-infra@redhat.com 2017-02-07 16:01:32 UTC
The Pulp upstream bug status is at CLOSED - WONTFIX. Updating the external tracker on this bug.

Comment 5 pulp-infra@redhat.com 2017-02-07 16:33:21 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2017-02-07 16:33:24 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 7 Michael Hrivnak 2017-02-07 16:44:01 UTC
Thank you for this report. We are going to track this issue upstream only, since it has no impact on behavioral correctness. I linked the upstream issue to this BZ, as you can see in the "External Trackers".

As far as we understand, the current behavior is safe:

https://pulp.plan.io/issues/1580#note-8

And it appears to be very difficult to eliminate or suppress those warnings. They can be safely ignored.

Comment 8 Michael Hrivnak 2017-02-07 17:50:48 UTC
Our bug-tracker-syncing automation doesn't like this being closed with a remote tracker at NEW, so I'm just moving that issue to a link here for now:

https://pulp.plan.io/issues/1655

Comment 9 pulp-infra@redhat.com 2017-02-15 18:33:46 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 10 pulp-infra@redhat.com 2017-02-15 18:33:48 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 13 pulp-infra@redhat.com 2019-06-27 12:35:36 UTC
The Pulp upstream bug status is at CLOSED - WONTFIX. Updating the external tracker on this bug.


Note You need to log in before you can comment on or make changes to this bug.