GODRIVER-2586 Add log messages to CMAP spec#1165
Merged
Merged
Conversation
…iver into GODRIVER-2586
matthewdale
reviewed
Feb 15, 2023
matthewdale
reviewed
Feb 17, 2023
matthewdale
reviewed
Feb 21, 2023
matthewdale
left a comment
Contributor
There was a problem hiding this comment.
Some comments about synchronization/buffering of json.Encoder, but everything else looks great!
matthewdale
reviewed
Feb 24, 2023
matthewdale
reviewed
Feb 24, 2023
matthewdale
approved these changes
Feb 24, 2023
matthewdale
left a comment
Contributor
There was a problem hiding this comment.
One suggestion to fix the ExampleClientOptions_SetLoggerOptions_customLogger test failures. Otherwise, looks good 👍
Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GODRIVER-2586
Summary
This PR adds log messages to CMAP operations.
Additional Updates
1. Add
Reasontype to the "event" and "logging" packagesThere is an unexported function in the x "topology" package used to source the event reason for the event monitor called "connectionPerished". The exact strings for the event reason differ between the "event" and "logging" packages. In order to unify the two packages, this PR proposes that we update the function signature to return a struct with fields for various reasons:
2. Unify Component Keys
Add constants to the logger/component.go file that represent "key names". This will unify the IO Sink, the serialization methods, and the key/values appended to logs messages through pool and command operations.
3. Closing v. Checkout Failure
The Go Driver creates it’s pool of connections in the background and there is always a realistic chance that a connection will close after a checkout fails. After careful consideration, the team doesn’t believe this behavior is a bug but a consequence of gracefully trying to concurrently deliver checkouts.
These issues will almost certainly come up again in the specifications PR #1369.
Multiple solutions have been proposed to resolve this issue:
To prevent GODRIVER-2586 from being blocked, this PR suggests that for the moment we relax the order requirements for logs with "ConnectionClosed" and "ConnectionCheckoutFailed" messages.
Background & Motivation
To add log messages and corresponding tests for connection pool logging.