Hi Christopher,

 thank you for answering.

Checking the thread id of the logs, all I can tell is that it looks
these errors weren't coming from application-managed threads since
they're in the shape of "http-nio-#port-exec-#number". There are
application-managed threads but for doing async some specific pieces
of the code (i.e. we don't use reactive code, the request itself is
managed by Spring Boot). I've only seen two occurrences of those two
stack traces so far, so it's not something that happens a lot and they
happened at arbitrary times, definitely not at deployment nor
shutdown. The app kept working as normal after this happened.

Thanks,
Tomás


On Fri, Sep 29, 2023 at 1:04 PM Christopher Schultz
<ch...@christopherschultz.net> wrote:
>
> Thomás,
>
> On 9/29/23 03:03, Tomás García wrote:
> > I've noticed these stack traces happening in the same row with Tomcat
> > 10.1.12, Java 17 and Spring Boot 3.1.3. I don't have a way to
> > reproduce them unfortunately. I thought that it could be related to
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=67235 but not sure.
> > Sharing them here in case it could be useful to pinpoint any issue in
> > case these are not already fixed in current development branch of
> > Tomcat or its latest version.
>
> Can you provide any more context? I don't see, for example, any
> application code in these stack traces which means something has caused
> Tomcat's own internal async state tracking to get confused about something.
>
> Are you using application-managed threads to handle your async requests?
> Can you provide some sample code for how you use them?
>
> Do these errors happen at arbitrary times, or could they be happening
> around application re-deployment, Tomcat shut-down, etc.?
>
> Anything else you could provide which would help?
>
> -chris
>
> > Stacktraces:
> > logger   org.apache.catalina.connector.CoyoteAdapter
> > message            Exception while processing an asynchronous request
> >
> > java.lang.IllegalStateException: Calling [asyncComplete()] is not
> > valid for a request with Async state [COMPLETING]
> >                at
> > org.apache.coyote.AsyncStateMachine.asyncComplete(AsyncStateMachine.java:345)
> >                at
> > org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:508)
> >                at org.apache.coyote.Request.action(Request.java:514)
> >                at
> > org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:91)
> >                at
> > org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:427)
> >                at
> > org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:155)
> >                at
> > org.apache.coyote.AbstractProcessor.dispatch(AbstractProcessor.java:243)
> >                at
> > org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:57)
> >                at
> > org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894)
> >                at
> > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740)
> >                at
> > org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
> >                at
> > org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
> >                at
> > org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
> >                at
> > org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> >                at java.base/java.lang.Thread.run(Thread.java:833)
> >
> > logger   org.apache.coyote.http11.Http11NioProtocol
> > message            Error reading request, ignored
> >
> > java.lang.NullPointerException: Cannot invoke
> > "org.apache.catalina.Context.bind(boolean, java.lang.ClassLoader)"
> > because "this.context" is null
> >                at
> > org.apache.catalina.core.AsyncContextImpl.fireOnComplete(AsyncContextImpl.java:101)
> >                at
> > org.apache.coyote.AsyncStateMachine.asyncPostProcess(AsyncStateMachine.java:286)
> >                at
> > org.apache.coyote.AbstractProcessor.asyncPostProcess(AbstractProcessor.java:197)
> >                at
> > org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:78)
> >                at
> > org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894)
> >                at
> > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740)
> >                at
> > org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
> >                at
> > org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
> >                at
> > org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
> >                at
> > org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> >                at java.base/java.lang.Thread.run(Thread.java:833)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to