Originally by CodingFabian
We have in our test environment quite some blocking threads like this
"http-bio-8443-exec-36" daemon prio=10 tid=0x00007f57545f8800 nid=0x1395 waiting on condition [0x00007f5742cce000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007a2154148> (a java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
at org.atmosphere.container.BlockingIOCometSupport.suspend(BlockingIOCometSupport.java:159)
at org.atmosphere.container.BlockingIOCometSupport.service(BlockingIOCometSupport.java:103)
at org.atmosphere.container.Tomcat7BIOSupportWithWebSocket.doService(Tomcat7BIOSupportWithWebSocket.java:65)
at org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:87)
at org.atmosphere.container.Tomcat7BIOSupportWithWebSocket.service(Tomcat7BIOSupportWithWebSocket.java:61)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1448)
at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:109)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1352)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:219)
I was wondering why the suspended connections do not disconnect.
If i saw it correctly in the code, PushHandler, uses suspend() inside the establishCallback:
resource.suspend();
AtmospherePushConnection connection = new AtmospherePushConnection(
ui, resource);
ui.setPushConnection(connection);
if the browser at the other end is no longer there, this connection will hang forever.
It seems that this code is only intended for the initial connection, so would it be possible to set a timeout on the suspend call? By doing so dead connections could be released.
Imported from https://dev.vaadin.com/ issue #12273
该提问来源于开源项目:vaadin/framework