-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.17.1, 5.9.1, 6.2.0
-
Component/s: SDAM
What problem are you facing?
The RTTPinger's hello command is always constructed with the legacy hello:
connection.command(ns('admin.$cmd'), { [LEGACY_HELLO_COMMAND]: 1 }...
When serverApi is enabled this causes an error to be sent to the driver:
MongoServerError: Provided apiStrict:true, but the command isMaster is not in API Version 1. Information on supported commands and migrations in API Version 1 can be found at https://dochub.mongodb.org/core/manual-versioned-api
This error is leading to leaked connections, it can be observed that after MongoClient.close the node process does not exit.
What driver and relevant dependency versions are you using?
Observed the resulting bug in 5.x and 6.x. 4.x also has legacy hello hardcoded.
Steps to reproduce?
See attached.
Dependencies
- The specifications - is there language about the RTTPinger in versioned-api using hello vs ismaster? Is there a way to spec or prose test this for all drivers?
Unknowns
- None
Acceptance Criteria
Implementation Requirements
- The rttPinger should respect serverApi and helloOk to determine whether hello or isMaster should be sent.
- The error handling for the rttPinger's hello only sets the rttPinger's connection to null, it should also destroy it.
Testing Requirements
- After creating a MongoClient with serverApi enabled spy on the rttPinger's connection and assert hello is sent to the server
- Using sinon, force a hello to "throw" (define an error in callback) and assert the connection was destroyed.
Documentation Requirements
- None
Follow Up Requirements
- Depending on the language spec, consider a drivers ticket if this behavior needs clarification.
There are no Sub-Tasks for this issue.