-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix: Improve server stop handling with graceful shutdowns #3525
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
fe744f5
to
f2eda53
Compare
This pull request includes several changes to improve the handling of server shutdowns and enhance test coverage for both gRPC and HTTP servers. The most important changes include modifications to the server shutdown logic, the addition of new tests, and synchronization improvements in the test code. Improvements to server shutdown logic:
Addition of new tests:
Synchronization improvements in test code:
These changes aim to enhance the robustness of server shutdown processes and improve the reliability of tests. |
6923897
to
8fcdefc
Compare
- Remove default stop timeout - Add context handling for server stop - Implement graceful stop for gRPC server - Enhance HTTP server shutdown logic - Use shared context for server operations
8fcdefc
to
54d2c99
Compare
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
…3525) * Improve server stop handling with graceful shutdowns - Remove default stop timeout - Add context handling for server stop - Implement graceful stop for gRPC server - Enhance HTTP server shutdown logic - Use shared context for server operations * Remove unnecessary error logging in gRPC server test
参考 gRPC 官方示例,当 Server 未能及时优雅退出时,执行强制退出。
https://github.com/grpc/grpc-go/blob/2fd426d0919db7e9e7920e365dd30674c4c9fe90/examples/features/gracefulstop/server/main.go#L89-L100