Skip to content
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

[Admin] simplify admin server implementation #1364

Merged
merged 3 commits into from Oct 4, 2021
Merged

[Admin] simplify admin server implementation #1364

merged 3 commits into from Oct 4, 2021

Conversation

synzhu
Copy link
Contributor

@synzhu synzhu commented Sep 27, 2021

This simplifies the implementation of admin server to remove the commandQ, which reduces the surface area for concurrency bugs.

gRPC will automatically create a new thread for each admin command, and the rate of admin commands will likely not reach the point where having a queue will be necessary.

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

this makes sense to me!

if handleErr := handler(ctx, data); handleErr != nil {
if errors.Is(handleErr, context.Canceled) {
return status.Error(codes.Canceled, "client canceled")
} else if errors.Is(handleErr, context.DeadlineExceeded) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can actually do without the if-elseif-else here since we have a return in each of those clauses

@synzhu
Copy link
Contributor Author

synzhu commented Oct 4, 2021

bors merge

bors bot added a commit that referenced this pull request Oct 4, 2021
1364: [Admin] simplify admin server implementation r=smnzhu a=smnzhu

This simplifies the implementation of admin server to remove the `commandQ`, which reduces the surface area for concurrency bugs.

gRPC will automatically create a new thread for each admin command, and the rate of admin commands will likely not reach the point where having a queue will be necessary.

Co-authored-by: Simon Zhu <simon.zsiyan@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

Build failed:

@synzhu
Copy link
Contributor Author

synzhu commented Oct 4, 2021

bors retry

bors bot added a commit that referenced this pull request Oct 4, 2021
1364: [Admin] simplify admin server implementation r=smnzhu a=smnzhu

This simplifies the implementation of admin server to remove the `commandQ`, which reduces the surface area for concurrency bugs.

gRPC will automatically create a new thread for each admin command, and the rate of admin commands will likely not reach the point where having a queue will be necessary.

Co-authored-by: Simon Zhu <simon.zsiyan@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

Build failed:

@synzhu
Copy link
Contributor Author

synzhu commented Oct 4, 2021

bors merge

bors bot added a commit that referenced this pull request Oct 4, 2021
1364: [Admin] simplify admin server implementation r=smnzhu a=smnzhu

This simplifies the implementation of admin server to remove the `commandQ`, which reduces the surface area for concurrency bugs.

gRPC will automatically create a new thread for each admin command, and the rate of admin commands will likely not reach the point where having a queue will be necessary.

Co-authored-by: Simon Zhu <simon.zsiyan@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

Build failed:

@synzhu
Copy link
Contributor Author

synzhu commented Oct 4, 2021

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

@bors bors bot merged commit 9f3c9e2 into master Oct 4, 2021
@bors bors bot deleted the smnzhu/admin-bug branch October 4, 2021 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants