Home / Function/ doGracefulShutdown() — netty Function Reference

doGracefulShutdown() — netty Function Reference

Architecture documentation for the doGracefulShutdown() function in Http2ConnectionHandler.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  401e2e76_994c_3bf5_9e43_754e2ba61459["doGracefulShutdown()"]
  a9ab361d_2417_0366_d9d0_ae1adb2145dc["Http2ConnectionHandler"]
  401e2e76_994c_3bf5_9e43_754e2ba61459 -->|defined in| a9ab361d_2417_0366_d9d0_ae1adb2145dc
  859f94fe_ed5e_1249_ef66_7ee4bcad0137["close()"]
  859f94fe_ed5e_1249_ef66_7ee4bcad0137 -->|calls| 401e2e76_994c_3bf5_9e43_754e2ba61459
  df92c2ff_9755_fb16_8a01_5a190020aec4["onConnectionError()"]
  df92c2ff_9755_fb16_8a01_5a190020aec4 -->|calls| 401e2e76_994c_3bf5_9e43_754e2ba61459
  799cf1ef_e488_9c39_1143_a17e89788c65["isGracefulShutdownComplete()"]
  401e2e76_994c_3bf5_9e43_754e2ba61459 -->|calls| 799cf1ef_e488_9c39_1143_a17e89788c65
  f04de241_cdc7_ec36_6253_6c13e215b0da["operationComplete()"]
  401e2e76_994c_3bf5_9e43_754e2ba61459 -->|calls| f04de241_cdc7_ec36_6253_6c13e215b0da
  style 401e2e76_994c_3bf5_9e43_754e2ba61459 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java lines 510–534

    private void doGracefulShutdown(ChannelHandlerContext ctx, ChannelFuture future, final ChannelPromise promise) {
        final ChannelFutureListener listener = newClosingChannelFutureListener(ctx, promise);
        if (isGracefulShutdownComplete()) {
            // If there are no active streams, close immediately after the GO_AWAY write completes or the timeout
            // elapsed.
            future.addListener(listener);
        } else {
            // If there are active streams we should wait until they are all closed before closing the connection.

            // The ClosingChannelFutureListener will cascade promise completion. We need to always notify the
            // new ClosingChannelFutureListener when the graceful close completes if the promise is not null.
            if (closeListener == null) {
                closeListener = listener;
            } else if (promise != null) {
                final ChannelFutureListener oldCloseListener = closeListener;
                closeListener = future1 -> {
                    try {
                        oldCloseListener.operationComplete(future1);
                    } finally {
                        listener.operationComplete(future1);
                    }
                };
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does doGracefulShutdown() do?
doGracefulShutdown() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java.
Where is doGracefulShutdown() defined?
doGracefulShutdown() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java at line 510.
What does doGracefulShutdown() call?
doGracefulShutdown() calls 2 function(s): isGracefulShutdownComplete, operationComplete.
What calls doGracefulShutdown()?
doGracefulShutdown() is called by 2 function(s): close, onConnectionError.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free