Blocking Read Timeout in Request API REST

125 views
Skip to first unread message

Rui Alves

unread,
Jul 21, 2021, 4:39:17 PM7/21/21
to Payara Forum
Hi,

I have this exception: java.io.IOException: Blocking read timeout

It happens when a GET web service is used with data of considerable size.


Can anyone help ?

Regards,

Rui

Petr Aubrecht

unread,
Aug 5, 2021, 6:16:50 PM8/5/21
to Payara Forum
Hi Rui,
do you have some reproducing app? Do you mean, that the GET is returning huge data?
I tried it just now and was able to get 2 GB:

@Path("sample")
public class SampleResource {
    @GET
    @Path("huge")
    public Response messageHuge(@QueryParam("count") @DefaultValue("1000") int count) {
        return Response.ok("x".repeat(count)).build();
    }
}


I tried also waiting for 15 minutes and I didn't get any timeout.
Do you have some more info, e.g. stacktrace?
Thank you,
Petr

Rui Alves

unread,
Sep 1, 2021, 1:20:48 PM9/1/21
to Payara Forum
Hi, Peter,

My apologies, but I’ve been on holidays and away from the computer.

 little of the stacktrace:

java.io.IOException: Blocking read timeout
at org.glassfish.grizzly.http2.DefaultInputBuffer.poll0(DefaultInputBuffer.java:271)
at org.glassfish.grizzly.http2.DefaultInputBuffer.poll(DefaultInputBuffer.java:236)
at org.glassfish.grizzly.http2.Http2Stream.pollInputData(Http2Stream.java:663)
at org.glassfish.grizzly.http2.Http2BaseFilter.checkIfHttp2StreamChain(Http2BaseFilter.java:792)
at org.glassfish.grizzly.http2.Http2ServerFilter.handleRead(Http2ServerFilter.java:428)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.read(DefaultFilterChain.java:328)
at org.glassfish.grizzly.filterchain.FilterChainContext.read(FilterChainContext.java:713)
at org.glassfish.grizzly.http.io.InputBuffer.blockingRead(InputBuffer.java:1113)
at org.glassfish.grizzly.http.server.io.ServerInputBuffer.blockingRead(ServerInputBuffer.java:72)
at org.glassfish.grizzly.http.io.InputBuffer.fill(InputBuffer.java:1137)
at org.glassfish.grizzly.http.io.InputBuffer.readByte(InputBuffer.java:306)
at org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:223)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:159)
at org.glassfish.jersey.message.internal.EntityInputStream.isEmpty(EntityInputStream.java:177)
at org.glassfish.jersey.message.internal.InboundMessageContext.hasEntity(InboundMessageContext.java:775)
at org.glassfish.jersey.servlet.WebComponent.filterFormParameters(WebComponent.java:591)
at org.glassfish.jersey.servlet.WebComponent.initContainerRequest(WebComponent.java:441)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:392)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1636)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:200)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
at java.lang.Thread.run(Unknown Source)


I suspect he gets a lot of requests and somehow doesn’t respond. I explained it wrong, the problem is not so much the size of the data that go in the POST, but the number of requests at the same time.

Rui


Reply all
Reply to author
Forward
0 new messages