-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-5608: CSOT: Command Execution #1709
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
base: main
Are you sure you want to change the base?
Conversation
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.
No major comments
var operationCountSelector = new OperationsCountServerSelector(Array.Empty<IClusterableServer>()); | ||
allSelectors.Add(operationCountSelector); | ||
|
||
return (new CompositeServerSelector(allSelectors), operationCountSelector, Stopwatch.StartNew()); |
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.
We should consider ClusterCompositeServerSelector
instead of this list creation. No necessary for this PR.
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.
LGTM!
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.
No major comments from me either. Great work!
EventContext.OperationName)); | ||
} | ||
|
||
public Exception HandleServerSelectionException(ClusterDescription clusterDescription, IServerSelector selector, Exception exception, Stopwatch stopwatch) |
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.
looks to me like an internal detail so can this be private?
Also given the name of the method, is it better if this method takes care of throwing the exception instead of returning the exception? what do you think?
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.
Changed to private, thanks! Cannot make the method throw, as it will confuse compiler and it will think we should return something from the method, as there will be no guaranty that HandleServerSelectionException
throws.
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.
LGTM!
This PR contains additional refactoring to Server Selection code, that is a part of Command Execution requirement. I've decided to have this as a separate PR to let more detailed review/investigation on the changes where and when we build list of connected servers used on Server Selection. The changes will let me easily capture both: selected server and server description that was used while the server selection, as we need that description to fulfill Command Execution requirements.