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

*: fix GracefulStop issue when using cmux for TLS #17790

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 15, 2024

  1. *: fix GracefulStop issue when using cmux for TLS

    The gRPC server supports to use GracefulStop to drain all the inflight RPCs,
    including streaming RPCs.
    
    When we use non-cmux mode to start gRPC server (non-TLS or
    TLS+gRPC-only), we always invoke GracefulStop to drain requests.
    
    For cmux mode (gRPC.ServeHTTP), since the connection is maintained by http
    server, gRPC server is unable to send GOAWAY control frame to client.
    So, it's always force close all the connections and doesn't drain
    requests by default.
    
    In gRPC v1.61.0 version, it introduces new experimental feature
    `WaitForHandlers` to block gRPC.Stop() until all the RPCs finish. This patch
    is to use `WaitForHandlers` for cmux mode's graceful shutdown.
    
    This patch also introduces `v3rpcBeforeSnapshot` failpoint. That's used
    to verify cmux mode's graceful shutdown behaviour.
    
    For TestAuthGracefulDisable (tests/common) case, increased timeout from
    10s to 15s because we try to graceful shutdown after connection closed
    and it takes more time than before.
    
    Signed-off-by: Wei Fu <fuweid89@gmail.com>
    fuweid committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    ac95dd7 View commit details
    Browse the repository at this point in the history