https://issues.apache.org/bugzilla/show_bug.cgi?id=55170
Bug ID: 55170 Summary: [websocket][jsr 356]Thread falls in endless cycle when connection is reset Product: Tomcat 8 Version: trunk Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: s.bos...@gmail.com Created attachment 30511 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30511&action=edit profiling result screenshot I have a client which opens websocket connection to the echo server example. My client sends unlimited number of binary messages. At some point, the connection is closed by a network component in the middle (load balancer). I can see exception thrown at the client side and the session is closed (see below <Exception 1>). So far this behaviour seems normal. However, after closing the session, I noticed there is something that uses CPU time, which after some profiling turned out to be a thread that executes CPU extensive code in an endless cycle (see below <Stack trace 1>) <Exception 1> Here is the exception that is thrown when the connection falls apart: Exception is :java.io.IOException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.io.IOException: The specified network name is no longer available. at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:203) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendBytes(WsRemoteEndpointImplBase.java:112) at org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendBinary(WsRemoteEndpointBasic.java:43) at com.sap.cloud.sample.helloworld.WebsocketsTestManager$TestThread.run(WebsocketsTestManager.java:257) Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.io.IOException: The specified network name is no longer available. at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$FutureToSendHandler.get(WsRemoteEndpointImplBase.java:719) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:201) ... 3 more Caused by: java.util.concurrent.ExecutionException: java.io.IOException: The specified network name is no longer available. at sun.nio.ch.PendingFuture.get(PendingFuture.java:185) at org.apache.tomcat.websocket.AsyncChannelWrapperSecure$WriteTask.run(AsyncChannelWrapperSecure.java:209) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: java.io.IOException: The specified network name is no longer available. at sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:309) at sun.nio.ch.Iocp.access$700(Iocp.java:46) at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399) ... 1 more <Stack trace 1> Here is the stacktrace of the thread consuming 100% CPU in an endless cycle: sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:757) javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) org.apache.tomcat.websocket.AsyncChannelWrapperSecure$ReadTask.run(AsyncChannelWrapperSecure.java:264) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:722) -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org