Home / Function/ nonHttp2ExceptionInPipelineShouldNotCloseConnection() — netty Function Reference

nonHttp2ExceptionInPipelineShouldNotCloseConnection() — netty Function Reference

Architecture documentation for the nonHttp2ExceptionInPipelineShouldNotCloseConnection() function in Http2ConnectionRoundtripTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  28e23e25_43a6_273e_d94b_57775bcfec12["nonHttp2ExceptionInPipelineShouldNotCloseConnection()"]
  0d6189e8_c033_39ff_d087_9019351440fe["Http2ConnectionRoundtripTest"]
  28e23e25_43a6_273e_d94b_57775bcfec12 -->|defined in| 0d6189e8_c033_39ff_d087_9019351440fe
  1dd685b8_9b56_5b35_70ca_7f2bf9016254["bootstrapEnv()"]
  28e23e25_43a6_273e_d94b_57775bcfec12 -->|calls| 1dd685b8_9b56_5b35_70ca_7f2bf9016254
  f8a98f5a_5b4f_5e46_24a0_b03b1f68c64a["setClientGracefulShutdownTime()"]
  28e23e25_43a6_273e_d94b_57775bcfec12 -->|calls| f8a98f5a_5b4f_5e46_24a0_b03b1f68c64a
  style 28e23e25_43a6_273e_d94b_57775bcfec12 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java lines 764–801

    @Test
    public void nonHttp2ExceptionInPipelineShouldNotCloseConnection() throws Exception {
        bootstrapEnv(1, 1, 2, 1);

        // Create a latch to track when the close occurs.
        final CountDownLatch closeLatch = new CountDownLatch(1);
        clientChannel.closeFuture().addListener(future -> closeLatch.countDown());

        // Create a single stream by sending a HEADERS frame to the server.
        final Http2Headers headers = dummyHeaders();
        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() throws Http2Exception {
                http2Client.encoder().writeHeaders(ctx(), 3, headers, 0, (short) 16, false, 0, false,
                        newPromise());
                http2Client.flush(ctx());
            }
        });

        // Wait for the server to create the stream.
        assertTrue(serverSettingsAckLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS));
        assertTrue(requestLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS));

        // Add a handler that will immediately throw an exception.
        clientChannel.pipeline().addFirst(new ChannelHandlerAdapter() {
            @Override
            public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
                throw new RuntimeException("Fake Exception");
            }
        });

        // The close should NOT occur.
        assertFalse(closeLatch.await(2, SECONDS));
        assertTrue(clientChannel.isOpen());

        // Set the timeout very low because we know graceful shutdown won't complete
        setClientGracefulShutdownTime(0);
    }

Domain

Subdomains

Frequently Asked Questions

What does nonHttp2ExceptionInPipelineShouldNotCloseConnection() do?
nonHttp2ExceptionInPipelineShouldNotCloseConnection() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java.
Where is nonHttp2ExceptionInPipelineShouldNotCloseConnection() defined?
nonHttp2ExceptionInPipelineShouldNotCloseConnection() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java at line 764.
What does nonHttp2ExceptionInPipelineShouldNotCloseConnection() call?
nonHttp2ExceptionInPipelineShouldNotCloseConnection() calls 2 function(s): bootstrapEnv, setClientGracefulShutdownTime.

Analyze Your Own Codebase

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

Try Supermodel Free