Details
-
Bug
-
Resolution: Done
-
Major
-
7.2.3.GA
-
+
-
Resolved in Undertow 2.0.27.Final
-
Description
NullPointerException can happen on the range request for a static content. This happens if the following conditions are met:
- A size of Range request is larger than the buffer size (16 KiB = 16384 Bytes by default)
- IOException (DEBUG level logging on io.undertow.request.io) occurs during sending the last part of the range response
(for example, a client browser close the connection or a front-end proxy closed the connection due to timeout)
ERROR [io.undertow.request] (default task-1) UT005071: Undertow request failed HttpServerExchange{ GET /test.txt}: java.lang.NullPointerException at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:156) at io.undertow.server.handlers.resource.PathResource$1ServerTask.onComplete(PathResource.java:200) at io.undertow.io.AsyncSenderImpl.invokeOnComplete(AsyncSenderImpl.java:413) at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:173) at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:187) at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:256) at io.undertow.server.handlers.resource.PathResource.serveRange(PathResource.java:118) at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:335) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1349) at java.lang.Thread.run(Thread.java:748)
It seems this NPE is harmless because the connection is already closed and no bad side effects happen to the response anymore. However, of course, it's better to avoid NPE.
Attachments
Issue Links
- clones
-
UNDERTOW-1595 NullPointerException can happen on a range request for a static content
- Resolved
- is cloned by
-
JBEAP-17601 [GSS](7.2.z) UNDERTOW-1595 - NullPointerException can happen on a range request for a static content
- Verified
- is incorporated by
-
JBEAP-17935 Upgrade Undertow to 2.0.28.SP1-redhat-00001
- Closed
- links to