Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-11834

Rest ResponseWrite CHUNKED_FILE response is blocking

    Details

    • Type: Bug
    • Status: New (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: REST
    • Labels:
      None

      Description

      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:

          <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)
      
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  william.burns Will Burns
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated: