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

Avoid interrupt inflight requests after a new socket connect failed #437

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from

Conversation

carter2000
Copy link

If mongoServer fail to dial server, it will close all sockets that are alive, whether they're currently use or not.
There are two cons:

  • Inflight requests will be interrupt rudely.
  • All sockets closed at the same time, and likely to dial server at the same time. Any occasional fail in the massive dial requests (high concurrency scenario) will make all sockets closed again, and repeat...(It happened in our production environment)

So I think sockets currently in use should closed after idle.

@domodwyer
Copy link

Hi @carter2000

This looks very interesting, and it's something we're interested in merging (if that's OK!) - do you have any tests for this?

Dom

@carter2000
Copy link
Author

@domodwyer
I use the patch two years ago in our production environment, and it works as expected all the time.

@carter2000
Copy link
Author

@fmpwizard
Copy link
Contributor

If you close and reopen the PR, travis will rerun this build and thanks to #462 , your PR should pass all tests on all mongodb versions

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

Successfully merging this pull request may close these issues.

3 participants