You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/01/23 23:54:04 UTC

[Bug 57489] New: java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

            Bug ID: 57489
           Summary: java.util.concurrent.ExecutionException:
                    java.io.IOException: Key must be cancelled
           Product: Tomcat 8
           Version: 8.0.15
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: wodencafe@gmail.com

Hello all,

we have been trying to track down the cause of some strange exceptions produced
by our application, that are related to the websocket connection somehow being
dropped.

This happens in multiple deployments of the application, but this one in
particular is on a Windows 8 Machine.

2015-01-22 15:14:09,599 CST WARN  [null] - Duplicate resource
7143de60-6212-4a06-8e2b-ce266c1d9769. Could be caused by a dead connection not
detected by your server. Replacing the old one with the fresh one 
2015-01-22 15:14:09,599 CST ERROR [null] - java.io.IOException:  
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:276) 
     at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:536) 
     at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:464) 
     at org.apache.tomcat.websocket.WsSession.close(WsSession.java:441) 
     at org.apache.tomcat.websocket.WsSession.close(WsSession.java:435) 
     at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:142) 
     at org.atmosphere.websocket.WebSocket.close(WebSocket.java:273) 
     at
org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:848) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:779) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:855) 
     at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:305) 
     at
com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:430) 
     at
com.vaadin.server.communication.PushHandler.onDisconnect(PushHandler.java:330) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:715) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:618) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:598) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.dirtyClose(AtmosphereResourceImpl.java:864) 
     at
org.atmosphere.cpr.DefaultBroadcaster.addAtmosphereResource(DefaultBroadcaster.java:1370) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.suspend(AtmosphereResourceImpl.java:408) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.suspend(AtmosphereResourceImpl.java:324) 
     at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:131) 
     at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253) 
     at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56) 
     at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74) 
     at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:205) 
     at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:104) 
     at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66) 
     at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075) 
     at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:570) 
     at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:215) 
     at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:198) 
     at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138) 
     at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) 
     at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) 
     at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) 
     at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) 
     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) 
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Key
must be cancelled 
     at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:269) 
     ... 39 more 
Caused by: java.io.IOException: Key must be cancelled 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84) 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61) 
     at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:162) 
     at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:129) 
     at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99) 
     at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:444) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:335) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:264) 
     ... 39 more 
Caused by: java.util.concurrent.ExecutionException: 
     at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:269) 
     at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:536) 
     at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:464) 
     at org.apache.tomcat.websocket.WsSession.close(WsSession.java:441) 
     at org.apache.tomcat.websocket.WsSession.close(WsSession.java:435) 
     at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:142) 
     at org.atmosphere.websocket.WebSocket.close(WebSocket.java:273) 
     at
org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:848) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:779) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:855) 
     at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:305) 
     at
com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:430) 
     at
com.vaadin.server.communication.PushHandler.onDisconnect(PushHandler.java:330) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:715) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:618) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:598) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.dirtyClose(AtmosphereResourceImpl.java:864) 
     at
org.atmosphere.cpr.DefaultBroadcaster.addAtmosphereResource(DefaultBroadcaster.java:1370) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.suspend(AtmosphereResourceImpl.java:408) 
     at
org.atmosphere.cpr.AtmosphereResourceImpl.suspend(AtmosphereResourceImpl.java:324) 
     at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:131) 
     at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253) 
     at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56) 
     at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74) 
     at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:205) 
     at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:104) 
     at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66) 
     at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075) 
     at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:570) 
     at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:215) 
     at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:198) 
     at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138) 
     at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) 
     at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) 
     at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) 
     at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) 
     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) 
Caused by: java.io.IOException: Key must be cancelled 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84) 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61) 
     at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:162) 
     at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:129) 
     at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99) 
     at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:444) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:335) 
     at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:264) 
     ... 39 more

Java 8
NIO connector

I reported this to the Atmosphere maintainer, who responded with the following:

jfarcand     
9:53 AM (6 hours ago)
Hi,
please file a bug in Tomcat, this is clearly an issue with NIO/Tomcat
implementation. It may happens less frequently with 2.2.5-SNAPSHOT, but still
the issue is with Tomcat.

Thanks

-- Jeanfrancois
On 2015-01-23 10:47 AM, Chris Boyd wrote:
Caused by: java.io.IOException: Key must be cancelled 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84) 
     at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61) 
     at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:162)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
Thanks for the feedback.

The CI system has highlighted a couple of issues with these fixes in place.
I've just found what I think is another instance of multiple write
registrations in trunk.

My plan is to get the CI system building trunk cleanly, port the fixes back to
8.0.x and then get the CI system for 8.0.x running cleanly. I don't think there
is much benefit in you testing any more until the CI system says the build is
clean. I'll ping this ticket when that is done.

Do you need me to build 8.0.x for you to test or are you happy building from
svn?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #10 from wodencafe@gmail.com ---
Hi Mark,

I built Tomcat from Trunk and tested again.

Unfortunately the issue happened again, here is the Stack Trace:

2015-02-10 16:01:13,056 CST ERROR [null] - java.io.IOException: 
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282)
    at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:570)
    at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:478)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:445)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:439)
    at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:104)
    at org.atmosphere.websocket.WebSocket.close(WebSocket.java:264)
    at org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:836)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:720)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:785)
    at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:294)
    at
com.vaadin.server.communication.AtmospherePushConnection.connect(AtmospherePushConnection.java:232)
    at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:135)
    at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)
    at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56)
    at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74)
    at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)
    at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
    at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:186)
    at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:160)
    at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
    at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
    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)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Key
must be cancelled
    at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275)
    ... 31 more
Caused by: java.io.IOException: Key must be cancelled
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84)
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:450)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:338)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:270)
    ... 31 more
Caused by: java.util.concurrent.ExecutionException:
    at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275)
    at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:570)
    at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:478)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:445)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:439)
    at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:104)
    at org.atmosphere.websocket.WebSocket.close(WebSocket.java:264)
    at org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:836)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:720)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:785)
    at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:294)
    at
com.vaadin.server.communication.AtmospherePushConnection.connect(AtmospherePushConnection.java:232)
    at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:135)
    at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)
    at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56)
    at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74)
    at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)
    at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
    at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:186)
    at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:160)
    at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
    at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
    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)
Caused by: java.io.IOException: Key must be cancelled
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84)
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:450)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:338)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:270)
    ... 31 more

I see a couple of minor differences between this Stack Trace and the previous
one, just in the line numbers of certain calls in a couple of places.

Please let me know when you need me to test more.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
I've added some debig logging to trunk, 8.0.x (for 8.0.19 onwards) and 7.0.x
(for 7.0.58 onwards). Any further information you can provide as to what is
going on would be very helpful.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #11 from Mark Thomas <ma...@apache.org> ---
I've fixed another issue. I don't think it will make any different but if you
could do a quick test it would be appreciated.

I've just noticed that the stack trace passes through the onOpen method of the
WebSocket Endpoint. That looks odd. I'm wondering if Atmosphere is doing
something we didn't anticipate with the API. I'll look further but I don't
expect to get this fixed for the next 8.0.x release. What I really need is a
simple test case to reproduce this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Hmm. Whatever is going wrong, is going wrong earlier than this stack trace.

Something causes the WebSocket connection to close. It appears that Atmosphere
isn't notified about this / doesn't notice it.

Something happens later that causes Atmosphere to realise there is a dead
WebSocket connection. Atmosphere triggers a 'dirty' close.

This 'dirty' close fails because the WebSocket connection has already been
closed. That triggers an error because, as far as I can tell, a normal
WebSocket close reason (1000) is used. If abnormal closure was used (1006),
Tomcat would swallow any error.

What we really need to figure out is why is this connection closed in the first
place. There isn't much in the way of debug logging for WebSocket session
closure in Tomcat - I'll fix that for the next release - but it is worth seeing
is Atmosphere's debug logging tells you anything useful.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #5 from wodencafe@gmail.com ---
Hi Mark,

I have been testing with the latest Trunk of 8.0.19, and verified that is the
case with this line in the logs:

2015-02-04 15:06:02,796 CST INFO  [null] - Atmosphere is using async support:
org.atmosphere.container.JSR356AsyncSupport running under container: Apache
Tomcat/8.0.19-dev using javax.servlet/3.0 using javax.servlet/3.0 and
jsr356/WebSocket API

Unfortunately, after interacting with the application for a brief amount of
time, it hangs and we see the same exception:

2015-02-04 15:07:01,691 CST ERROR [null] - java.io.IOException: 
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282)
    at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:570)
    at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:478)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:445)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:439)
    at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:104)
    at org.atmosphere.websocket.WebSocket.close(WebSocket.java:264)
    at org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:836)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:720)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:785)
    at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:294)
    at
com.vaadin.server.communication.AtmospherePushConnection.connect(AtmospherePushConnection.java:232)
    at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:135)
    at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)
    at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56)
    at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74)
    at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)
    at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
    at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:186)
    at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:160)
    at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
    at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
    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)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Key
must be cancelled
    at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275)
    ... 31 more
Caused by: java.io.IOException: Key must be cancelled
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84)
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:162)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:129)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:450)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:338)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:270)
    ... 31 more
Caused by: java.util.concurrent.ExecutionException:
    at
org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275)
    at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:570)
    at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:478)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:445)
    at org.apache.tomcat.websocket.WsSession.close(WsSession.java:439)
    at
org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:104)
    at org.atmosphere.websocket.WebSocket.close(WebSocket.java:264)
    at org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:836)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:720)
    at
org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:785)
    at
com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:294)
    at
com.vaadin.server.communication.AtmospherePushConnection.connect(AtmospherePushConnection.java:232)
    at com.vaadin.server.communication.PushHandler$2.run(PushHandler.java:135)
    at
com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:253)
    at
com.vaadin.server.communication.PushHandler.access$200(PushHandler.java:56)
    at
com.vaadin.server.communication.PushHandler$1.onRequest(PushHandler.java:74)
    at
org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:174)
    at
org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
    at
org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
    at
org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:432)
    at
org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:186)
    at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:160)
    at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
    at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
    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)
Caused by: java.io.IOException: Key must be cancelled
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWriteInternal(NioServletOutputStream.java:84)
    at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doWrite(NioServletOutputStream.java:61)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:162)
    at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:129)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:99)
    at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:450)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:338)
    at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:270)
    ... 31 more

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #9 from Mark Thomas <ma...@apache.org> ---
OK. I've made various changes to 8.0.x that should at least make this less
likely and hopefully prevent. If you could test with the current 8.0.x and let
us know the results that would be great.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #8 from Christopher Schultz <ch...@christopherschultz.net> ---
(In reply to wodencafe from comment #7)
> I ran "svn update", then "ant", and finally copied the built
> libs into my Tomcat 8 server for testing.

That's the correct procedure. If you are using split CATALINA_BASE and
CATALINA_HOME (a great thing to do IMO), you can just point your CATALINA_HOME
to the directory you have your svn working copy in, under output/build,
something like this:

$ export CATALINA_BASE=[...]
$ export CATALINA_HOME=/path/to/tomcat-svn/output/build
$ $CATALINA_HOME/bin/catalina.sh start

You can always go back to your previous Tomcat (8.0.18, etc.) by switching
CATALINA_HOME back to its previous value.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

wodencafe@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Linux                       |Windows 8

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #7 from wodencafe@gmail.com ---
Hi Mark,

I am fine with building SVN, as long as I am doing it correctly :)

What I did today was I went into the directory where I had Tomcat trunk checked
out, I ran "svn update", then "ant", and finally copied the built libs into my
Tomcat 8 server for testing.

This is the correct process, right?

Let me know when to test again.

Thank you,

Chris Boyd

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
I've just fixed some issues that might have triggered this sort of issue in
trunk and 8.0.x. There is a development build of 8.0.19-dev here:
http://people.apache.org/~markt/dev/v8.0.19-dev/

Any feedback you can provide on testing with this or 8.0.x trunk would be
great.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57489] java.util.concurrent.ExecutionException: java.io.IOException: Key must be cancelled

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57489

--- Comment #3 from Jean-Francois Arcand <jf...@apache.org> ---
@Mark,

I did hack a little to prevent that error (which I may not fixed completely)

https://github.com/Atmosphere/atmosphere/issues/1646

The stack trave will probably help you.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org