dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

[Feature] Graceful Shutdown Requirements for HTTP/3 Server Side

Open oxsean opened this issue 11 months ago • 1 comments

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 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

oxsean avatar Dec 26 '24 15:12 oxsean

I'm interested with it, it's anyone work in progress?

aofall avatar Jan 10 '25 14:01 aofall