Summary
When a server enters quiesce mode, the Java driver will repeatedly open and close monitoring connections to that server in a tight loop, leading to high connection churn.
This affects Java driver 4.7.0, but could date as far back as 4.1.
Affects MongoDB 5.0+ replica sets and sharded clusters.
How to Reproduce
- Start a 5.0 replica set
- Connect the driver to a secondary with directConnection=true, enable logging
- Execute a ping command
- Sleep the thread
- Kill the secondary the driver is connected to (SIGTERM)
- Observe repeated connection creation for the duration of the quiesce period
Additional Background
See this comment for additional information.
- related to
-
DRIVERS-2458 Add test that monitors do not create excessive connections during quiesce mode
- Backlog