[Feature] Graceful Shutdown Requirements for HTTP/3 Server Side
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
### Pre-check
- [X] I am sure that all the content I provide is in English.
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar feature requirement.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Descriptions
**Objective:**
Implement a robust graceful shutdown mechanism for the HTTP/3 server connection handler using Netty's HTTP/3 incubator codec, focusing on leveraging the control stream for ping-pong and graceful shutdown (GOAWAY) logic.
Please refer to org.apache.dubbo.rpc.protocol.tri.transport.TripleServerConnectionHandler.
**Key Requirements:**
1. **Control Stream Utilization**
- Utilize `io.netty.incubator.codec.http3.Http3.getLocalControlStream()` as the primary mechanism for managing connection state and initiating graceful shutdown.
- Implement a bidirectional ping-pong mechanism to verify connection health and readiness for shutdown.
2. **Ping-Pong Mechanism**
- Develop a lightweight ping-pong protocol on the control stream to:
a) Validate active connections
b) Detect connection responsiveness
c) Prepare for graceful termination
- Create a configurable ping interval and timeout strategy
- Handle scenarios where ping responses are delayed or missing
3. **Graceful Shutdown (GOAWAY) Workflow**
- Design a GOAWAY process that:
a) Stops accepting new requests
b) Allows existing in-flight requests to complete
c) Provides a configurable grace period for request completion
- Implement a systematic shutdown sequence using control stream signaling
- Ensure all active streams are properly closed or terminated
4. **Error Handling and Resilience**
- Implement comprehensive error handling for control stream operations
- Provide logging and metrics for shutdown-related events
- Handle potential network interruptions during the shutdown process
### Related issues
_No response_
### Are you willing to submit a pull request to fix on your own?
- [X] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start with org.apache.dubbo.rpc.protocol.tri.transport.TripleServerConnectionHandler and inspect how Netty's Http3.getLocalControlStream() is currently used. Review the HTTP/3 incubator codec's control-stream and GOAWAY APIs before defining the shutdown sequence. Done means configurable ping-pong handling, graceful request draining, stream termination, and shutdown error logging and metrics are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100