[GODRIVER-2855] Include "ConnectionPoolCleared" in "isUnorderedLog" logger verification Created: 22/May/23  Updated: 20/Jun/23  Resolved: 20/Jun/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Preston Vasquez Assignee: Preston Vasquez
Resolution: Done Votes: 0
Labels: greenerbuild
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

The existing unified spec test for connection logging has a specific order required for the following three events: ConnectionPoolCleared, ConnectionPoolClosed, ConnectionCheckOutFailed. There is an acceptable race condition in the connection pool's workflow where it is non-deterministic whether the connection pool will fail a checkout or close a connection first. Because of this, either ConnectionPoolClosed or ConnectionCheckOutFailed may be received in any order. Currently, to account for this behavior, we considered both logs to be "unordered".

Occasionally, an EG task will fail with the following:

[2023/05/22 22:50:21.735] === RUN   TestUnifiedSpec/connection-monitoring-and-pooling/logging/connection-logging.json/Connection_checkout_fails_due_to_error_establishing_connection[2023/05/22 22:50:21.735]     unified_spec_runner.go:134: error verifying log messages: logger verification failed: client: logger verification failed: document length mismatch: comparison error at key "message": expected value "Connection checkout failed", got "Connection pool cleared" 

It appears that it is possible that the logs would propagate in this order:

ConnectionCheckOutFailed, ConnectionPoolCleared, ConnectionPoolClosed

This is still technically allowed, the only condition per this slack thread is that "the pool clear does need to come before the connectionclosed."

We should account for this in the isUnorderedLog function. One solution could be to maintain the state of the pool events in the "logQueues" struct.

Definition of complete: Update "partitionLogQueue" function and "isUnorderedLog" function to allow any order of failed and cleared, but ensure that closed ALWAYS comes after cleared.



 Comments   
Comment by Githook User [ 13/Jun/23 ]

Author:

{'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}

Message: GODRIVER-2855 Relax closed, cleared, checkout conditions on logger verification (#1287)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/7d13bebd84fc81ba4e345879789ae63dadcac1fc

Generated at Thu Feb 08 08:39:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.