You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a StaticHandler with async fs enabled.
When I handle the requests with a HTTP2 server, if a client closes the connection after fetching the first x bytes, the internal AsyncFile does not have any failure handler, so it prints an unhandled exception in the log output:
2024-03-13 17:54:27.722 ERROR 141868 AsyncFile : Unhandled exception
java.nio.channels.ClosedChannelException
at java.base/sun.nio.ch.SimpleAsynchronousFileChannelImpl.implRead(SimpleAsynchronousFileChannelImpl.java:307)
at java.base/sun.nio.ch.AsynchronousFileChannelImpl.read(AsynchronousFileChannelImpl.java:229)
at io.vertx.core@4.5.4/io.vertx.core.file.impl.AsyncFileImpl.doRead(AsyncFileImpl.java:510)
at io.vertx.core@4.5.4/io.vertx.core.file.impl.AsyncFileImpl.doRead(AsyncFileImpl.java:418)
at io.vertx.core@4.5.4/io.vertx.core.file.impl.AsyncFileImpl.doRead(AsyncFileImpl.java:397)
at io.vertx.core@4.5.4/io.vertx.core.file.impl.AsyncFileImpl.lambda$new$1(AsyncFileImpl.java:120)
at io.vertx.core@4.5.4/io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:255)
at io.vertx.core@4.5.4/io.vertx.core.streams.impl.InboundBuffer.drain(InboundBuffer.java:245)
at io.vertx.core@4.5.4/io.vertx.core.streams.impl.InboundBuffer.lambda$fetch$0(InboundBuffer.java:295)
at io.vertx.core@4.5.4/io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:276)
at io.vertx.core@4.5.4/io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:258)
at io.vertx.core@4.5.4/io.vertx.core.impl.ContextInternal.lambda$runOnContext$0(ContextInternal.java:56)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask$$$capture(AbstractEventExecutor.java:173)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:166)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.transport@4.1.107.Final/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.common@4.1.107.Final/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.common@4.1.107.Final/io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1583)
Do you have a reproducer?
I don't have a reproducer, but if you look at the stacktrace, the problem is simple: the StaticHandler does not set a failure handle in the AsyncFile, and it does not even expose a way to set it, so it's impossible to handle the exception in any way.
Steps to reproduce
Create a http2 webserver
Add a StaticHandler in the root path
Enable async fs in the StaticHandler
Start a file request of a big file, like a video, but cancel it after fetching some initial bytes (like a browser does to fetch the first video frames)
That unhandled error will be printed in the console
Extra
Anything that can be relevant such as OS version, JVM version
The text was updated successfully, but these errors were encountered:
Version
4.5.4
Context
I have a StaticHandler with async fs enabled.
When I handle the requests with a HTTP2 server, if a client closes the connection after fetching the first x bytes, the internal AsyncFile does not have any failure handler, so it prints an unhandled exception in the log output:
Exception
Do you have a reproducer?
I don't have a reproducer, but if you look at the stacktrace, the problem is simple: the StaticHandler does not set a failure handle in the AsyncFile, and it does not even expose a way to set it, so it's impossible to handle the exception in any way.
Steps to reproduce
Extra
The text was updated successfully, but these errors were encountered: