`available()` only tells you how many bytes you can read without blocking; it doesn't tell if you're at the end of the stream. Actually it returns -1 or an error when at end of stream
ChunkedInputStream isEndOfInput blocks event loop
In all versions of netty the ChunkedInputStream isEndOfInput uses b.read() which is blocking. This should instead use available()
handler/src/main/java/io/netty/handler/stream/ChunkedStream.java
handler/src/main/java/io/netty/handler/stream/ChunkedStream.java
transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelConfigTest.java
diff --git a/handler/src/main/java/io/netty/handler/stream/ChunkedStream.java b/handler/src/main/java/io/netty/handler/stream/ChunkedStream.java
index 8f67df20f8d..86e3f5d5c71 100644
--- a/handler/src/main/java/io/netty/handler/stream/ChunkedStream.java
+++ b/handler/src/main/java/io/netty/handler/stream/ChunkedStream.java
@@ -79,6 +79,9 @@ public boolean isEndOfInput() throws Exception {
         if (closed) {
             return true;
         }
+        if (in.available() > 0) {
+            return false;
+        }
 
         int b = in.read();
         if (b < 0) {

diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelConfigTest.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelConfigTest.java
index a859085aeae..299183d89d6 100644
--- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelConfigTest.java
+++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSocketChannelConfigTest.java
@@ -155,7 +155,7 @@ public void testGetOptionWhenClosed() {
             if (!(e.getCause() instanceof ClosedChannelException)) {
                 AssertionError error = new AssertionError(
                         "Expected the suppressed exception to be an instance of ClosedChannelException.");
-                error.addSuppressed(e.getCause());
+                error.addSuppressed(e);
                 throw error;
             }
         }
