Will Burns created ISPN-11834:
---------------------------------
Summary: Rest ResponseWrite CHUNKED_FILE response is blocking
Key: ISPN-11834
URL:
https://issues.redhat.com/browse/ISPN-11834
Project: Infinispan
Issue Type: Bug
Components: REST
Reporter: Will Burns
The CHUNKED_FILE annotation blocks while trying to write the response since it has to read
from the underlying disk. This can be seen from the StaticResourceTest.
Here is an example stack trace:
{code}
<failure type="java.lang.AssertionError" message="Blocking call!
java.io.RandomAccessFile#readBytes on thread
Thread[REST-StaticResourceTest-StaticResourceTest-NodeA-ServerIO-81-1,5,main]">
<![CDATA[java.lang.AssertionError: Blocking call!
java.io.RandomAccessFile#readBytes on thread
Thread[REST-StaticResourceTest-StaticResourceTest-NodeA-ServerIO-81-1,5,main]
at
org.infinispan.util.CoreTestBlockHoundIntegration.lambda$applyTo$0(CoreTestBlockHoundIntegration.java:44)
at reactor.blockhound.BlockHound$Builder.lambda$install$8(BlockHound.java:383)
at reactor.blockhound.BlockHoundRuntime.checkBlocking(BlockHoundRuntime.java:89)
at java.base/java.io.RandomAccessFile.readBytes(RandomAccessFile.java)
at java.base/java.io.RandomAccessFile.read(RandomAccessFile.java:406)
at java.base/java.io.RandomAccessFile.readFully(RandomAccessFile.java:470)
at io.netty.handler.stream.ChunkedFile.readChunk(ChunkedFile.java:149)
at io.netty.handler.stream.ChunkedFile.readChunk(ChunkedFile.java:35)
at io.netty.handler.codec.http.HttpChunkedInput.readChunk(HttpChunkedInput.java:102)
at io.netty.handler.codec.http.HttpChunkedInput.readChunk(HttpChunkedInput.java:43)
at io.netty.handler.stream.ChunkedWriteHandler.doFlush(ChunkedWriteHandler.java:230)
at io.netty.handler.stream.ChunkedWriteHandler.flush(ChunkedWriteHandler.java:132)
at
io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750)
at
io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:765)
at
io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790)
at
io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758)
at org.infinispan.rest.ResponseWriter$3.writeResponse(ResponseWriter.java:69)
at
org.infinispan.rest.BaseHttpRequestHandler.lambda$sendResponse$0(BaseHttpRequestHandler.java:46)
at
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
at
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)