Skip to content

RUBY-2132 improve connection reconnection after fork #1918

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

Merged
merged 27 commits into from
May 26, 2020

Conversation

p-mongo
Copy link
Contributor

@p-mongo p-mongo commented May 20, 2020

https://jira.mongodb.com/browse/RUBY-2132

  • Remove pid checks from non-monitoring connections and place them into connection pool. This permits the pool to close/discard connections from the parent process in the child, instead of these connections getting reconnected in place.
  • When operation on connections fail with network errors, mark connections as errored and do not check them into pools.
  • The monitoring connections still need the pid check for the time being, moved it into the monitoring connection from connection base.
  • Add an integration test for using monitoring connection after fork (this is transparently supported for now).
  • Add an integration test for using a client after fork without reconnection. This does work but new non-monitoring connections are created for operations by the pool.
  • Add a stress test where multiple forked children are performing operations on the client created in the parent, without reconnecting. This intermittently fails in evergreen due to I assume network connectivity issues in ec2. Set this test to retry twice.
  • Add a stress test where the parent performs operations while forked children are also performing operations on the same client without reconnecting. Operations need to be retryable by the driver (e.g. reads) to not have any application errors.
  • All of the fork tests are skipped on jruby.
  • Connection generation number added to command started events for diagnostics, and to error notes for the same reason.
  • Unit tests that mock two consecutive ismaster failures may need to be revisited in the future, since this no longer works naively due to ismasters being sent on different driver connections.

@p-mongo p-mongo changed the title RUBY-2132 test simple client operation after fork RUBY-2132 test connection reconnection and simple client operation after fork May 20, 2020
@p-mongo p-mongo force-pushed the 2132-fork branch 7 times, most recently from 9e707f9 to d57355f Compare May 20, 2020 20:39
@p-mongo p-mongo changed the title RUBY-2132 test connection reconnection and simple client operation after fork RUBY-2132 improve connection reconnection after fork May 20, 2020
@p-mongo p-mongo force-pushed the 2132-fork branch 5 times, most recently from bf5a9fe to be76ecc Compare May 21, 2020 00:39
@p-mongo p-mongo merged commit 065281d into mongodb:master May 26, 2020
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