- Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-4347: Add log messages to Server selection spec #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
JamesKovacs left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback and questions for your consideration.
| _rapidHeartbeatTimer.Change(TimeSpan.Zero, _minHeartbeatInterval); | ||
| } | ||
| | ||
| _serverSelectionEventLogger.LogAndPublish(new ClusterEnteredSelectionQueueEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to ask about allocating an object even if logging isn't enabled, but I see all the events are structs and thus won't incur heap allocation overhead. Very clever!
| _description, | ||
| selector, | ||
| -1, | ||
| EventContext.OperationName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we return an operationId of null for SelectServer but -1 for SelectServerAsync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| _server.Description, | ||
| TimeSpan.FromSeconds(1), | ||
| -1, | ||
| EventContext.OperationName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Why -1 for async but null for sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, should be null.
| e.ClusterDescription.ToString(), | ||
| "Server selection failed", | ||
| "exception123")); | ||
| //e.Exception?.ToString())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug code exception123 should be replaced with commented impl on line 91.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, tnx.
| | ||
| // private methods | ||
| private IDisposable BeginOperation() => EventContext.BeginOperation(null, "listDatabases"); | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing calls to BeginOperation in Execute and ExecuteAsync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above comment needs addressing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, BeginOperation removed.
| break; | ||
| | ||
| case "tags": | ||
| case "tagSets": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unrelated. Move to another ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new tests add this tag. Example.
JamesKovacs left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment was missed.
| | ||
| // private methods | ||
| private IDisposable BeginOperation() => EventContext.BeginOperation(null, "listDatabases"); | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above comment needs addressing.
No description provided.