eclipse-ee4j / eclipse-ee4j/jersey

Netty Connector hangs instead of timing out on flush

Open
#5,778 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

This is a follow on to #5753

Even with the fix for that applied, our app sometimes ends up hanging after a particular nioEventLoopGroup thread goes into an infinite loop. In this case, the call from io.netty.handler.stream.ChunkedWriteHandler.doFlush goes into org.glassfish.jersey.netty.connector.internal.JerseyChunkedInput.readChunk() (instead of write()) but the effect is the same: there is a timeout on the queue.poll() call, control returns to the doFlush() method, but because the stream is still writable, the doFlush() method continues to call readChunk().

We have not been able to get a simple reproducer for this test case as we were for the other, but it's clear that the code is not honoring the READ_TIMEOUT here if it returns Unpooled.EMPTY_BUFFER when the queue.poll() call times out. I would assume that we should again throw an IOException() here for the timeout.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.