-
Notifications
You must be signed in to change notification settings - Fork 10
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
chore: gracefully shutdown when error encountered #152
Conversation
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
} | ||
} | ||
|
||
public Server createServer( |
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 is mostly copied from GrpcServerUtils.java. We need to manage the state of event loop groups hence I created this class.
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
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 under the impression that shutting down the server would also shut down the event loops.
The changes look good to me.
One suggestion: We shouldn't expose the event loop-related details to all the components. The event loops are only used by the io.grpc.Server
. Instead of using GrpcServerHelper
, could we write a wrapper for io.grpc.Server
that exposes the necessary methods to create, start, gracefully stop, and force stop the server? This way, it can be abstracted out, and inside the wrapper, you can also shut down the event loops.
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Java Gracefully Shutdown Testing Notes
Test Pipeline
gRPC Server Log
gRPC Client Log
build
Test Pipeline
gRPC Server Log
gRPC Client Log
build
Test Pipeline
gRPC Server Log
gRPC Client Log
build
Test Pipeline
gRPC Server Log
gRPC Client Log
build
Test Pipeline
gRPC Server Log
gRPC Client Log
build
Test Pipeline
gRPC Server Log
gRPC Client Log
Build