许多 Tomcat 个线程正在休眠 - org.apache.catalina.connector.CoyoteAdapter.postParseRequest

many Tomcat Threads sleeping - org.apache.catalina.connector.CoyoteAdapter.postParseRequest

虽然我的 tomcat 服务器已启动并正常工作,但它无法处理来自某个特定应用程序的请求 - 浏览器将一直旋转(仅在简单的登录页面本身)。没有错误。从多个线程转储中,我只看到一个可疑的。有 100 个线程在休眠,所有相同的堆栈跟踪。

为什么所有这些线程都在 CoyoteAdapter.postParseRequest 休眠?

http-nio-8080-exec-159 - priority:6 - threadId:0x000000000f5f5000 - nativeId:0x658 - state:TIMED_WAITING
stackTrace:
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:754)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
- locked <0x00000007dcc67fe8> (a org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

正在查看 the tomcat source code, the postParseRequest will sleep if the context is paused, the context gets paused while it is being reloaded

查看您的线程转储以查看哪个线程正在重新加载上下文,应该可以更清楚地说明该问题。