Home / Function/ writeFailureFlowControllerRemoveFrame() — netty Function Reference

writeFailureFlowControllerRemoveFrame() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java lines 711–762

    @Test
    public void writeFailureFlowControllerRemoveFrame()
            throws Exception {
        bootstrapEnv(1, 1, 3, 1);

        final ChannelPromise dataPromise = newPromise();
        final ChannelPromise assertPromise = newPromise();

        runInChannel(clientChannel, new Http2Runnable() {
            @Override
            public void run() throws Http2Exception {
                http2Client.encoder().writeHeaders(ctx(), 3, EmptyHttp2Headers.INSTANCE, 0, (short) 16, false, 0, false,
                        newPromise());
                clientChannel.pipeline().addFirst(new ChannelOutboundHandlerAdapter() {
                    @Override
                    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
                        ReferenceCountUtil.release(msg);

                        // Ensure we update the window size so we will try to write the rest of the frame while
                        // processing the flush.
                        http2Client.encoder().flowController().initialWindowSize(8);
                        promise.setFailure(new IllegalStateException());
                    }
                });

                http2Client.encoder().flowController().initialWindowSize(4);
                http2Client.encoder().writeData(ctx(), 3, randomBytes(8), 0, false, dataPromise);
                assertTrue(http2Client.encoder().flowController()
                        .hasFlowControlled(http2Client.connection().stream(3)));

                http2Client.flush(ctx());

                try {
                    // The Frame should have been removed after the write failed.
                    assertFalse(http2Client.encoder().flowController()
                            .hasFlowControlled(http2Client.connection().stream(3)));
                    assertPromise.setSuccess();
                } catch (Throwable error) {
                    assertPromise.setFailure(error);
                }
            }
        });

        ExecutionException e = assertThrows(ExecutionException.class, new Executable() {
            @Override
            public void execute() throws Throwable {
                dataPromise.get();
            }
        });
        assertInstanceOf(IllegalStateException.class, e.getCause());
        assertPromise.sync();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free