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

docs: investigation of mongodb unavailability on 2023/10/14 #265

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

stephanegigandet
Copy link
Contributor

The reason for the unavailability of MongoDB this weekend seems to be something written in Python running on ovh2.

@sweep-ai
Copy link

sweep-ai bot commented Oct 16, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@stephanegigandet stephanegigandet changed the title doc: investigation of mongodb unavailability on 2023/10/14 docs: investigation of mongodb unavailability on 2023/10/14 Oct 16, 2023
@raphael0202
Copy link
Contributor

Pymongo 3.12.3 and Python 3.11 is definitely Robotoff. I'm looking into it.

@raphael0202
Copy link
Contributor

After some investigation, it's not clear why there were so many connections attempts from pymongo. It's clear however that it tried to reconnect many times to MongoDB: https://openfoodfacts.sentry.io/issues/4339801224/events/92bac62eb9ea4ad1a38cb207af088060/?project=1415205

Connection pooling is handled by Pymongo entirely, and we're currently respecting client creation best practices (not creating the client before forking).
In Pymongo 4.0, one of the improvement is a better connection management to avoid "connection storms" (https://pymongo.readthedocs.io/en/stable/changelog.html#breaking-changes-in-4-0), upgrading from 3.12 to 4.5 would possibly help.

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the remarks of Raphaël on robotoff side.

I think we can merge. Alright @stephanegigandet ?

@stephanegigandet stephanegigandet merged commit d117523 into develop Oct 25, 2023
5 checks passed
@stephanegigandet stephanegigandet deleted the 2023-10-14-mongodb-down branch October 25, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants