Abhishek Pal created RATIS-2637:
-----------------------------------

             Summary: Netty RPC lacks per-connection read backpressure
                 Key: RATIS-2637
                 URL: https://issues.apache.org/jira/browse/RATIS-2637
             Project: Ratis
          Issue Type: Improvement
          Components: Netty
            Reporter: Abhishek Pal
            Assignee: Abhishek Pal


After Netty RPC handling is offloaded to a worker pool, 
NettyRpcService.InboundHandler.channelRead0 reads every inbound request off the 
socket immediately and chains it as a pending CompletableFuture stage (holding 
the request proto) on the shared request executor (unbounded 
LinkedBlockingQueue).

Reads are never paused, so there is no TCP backpressure.

We should  cap in-flight requests per channel and when the cap is reached set 
`ctx.channel().config().setAutoRead(false)` and re-enable once drained. This 
bounds memory, restoring TCP backpressure.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to