Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sanych-sun
Copy link
Member

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.

@sanych-sun sanych-sun requested a review from a team as a code owner June 12, 2025 18:53
Copy link
Contributor

@BorisDog BorisDog left a 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());
Copy link
Contributor

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.

Oleksandr Poliakov added 3 commits June 13, 2025 16:01
@sanych-sun sanych-sun requested a review from BorisDog June 13, 2025 23:30
Copy link
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@adelinowona adelinowona left a 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)
Copy link
Contributor

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?

Copy link
Member Author

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.

@sanych-sun sanych-sun requested a review from adelinowona June 14, 2025 00:36
Copy link
Contributor

@adelinowona adelinowona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants