-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Authentication, CMAP, Load Balancer
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Use Case
The auth spec mandates that, when we fail to authenticate, we must mark the server as unknown and clear the pool (https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#q-and-a:~:text=If%20the%20authentication%20handshake%20fails%20for%20a%20socket%2C%20drivers%20MUST%20mark%20the%20server%20Unknown%20and%20clear%20the%20server%27s%20connection%20pool.). In load balanced mode, the Node driver does not clear the pool after an authentication failure.
The rationale in the spec is:
The Authentication spec requires that when authentication fails on a server, the driver MUST clear the server's connection pool. Clearing the pool without marking the server Unknown would leave the pool in the "paused" state while the server is still selectable. When auth fails due to invalid credentials, marking the server Unknown also serves to rate limit new connections; future operations will need to wait for the server to be rediscovered.
In lb mode, there is only ever a single server, so the impact on server selection isn't relevant. However, we are still not spec compliant because we don't clear the pool in this scenario.
User Experience
- tbd
Dependencies
- n/q
Risks/Unknowns
- n/a
Acceptance Criteria
Implementation Requirements
- Ensure that the pool is cleared after a network error during the initial handshake in load balanced mode
Testing Requirements
- Unskip `errors during authentication are processed`
Documentation Requirements
- n/a
Follow Up Requirements
- additional tickets to file, required releases, etc
- if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward