tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Preißer <kpreis...@apache.org>
Subject RE: 8.0.x / 7.0.x progress
Date Tue, 01 Oct 2013 21:56:28 GMT
Hi Mark,

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Tuesday, October 1, 2013 8:39 PM
> To: Tomcat Developers List
> Subject: 8.0.x / 7.0.x progress
> 
> Pulling together information from multiple threads:
> 
> 8.0.x trunk appears to be stable (i.e. no longer crashes) but the
> FormAuthenticator unit tests are very slow (24 minutes). This needs to
> be resolved.

I noticed something strange with the Snake WebSocket example when running current trunk (r1528211)
on Windows (x64) with 64-bit version of tcnative-1.dll (version 1.1.29 - from Mladen: http://people.apache.org/~mturk/native/tomcat-native-win32-x86_64-r1528132.zip).

If I open the snake.xhtml with Firefox and with Chrome, press the "up" key so that the snakes
move, and then close Chrome, Tomcat does not seem to realize that the underlying TCP connection
of the WebSocket connection has been closed, and the snake keeps running. However if I do
this with IE 10 or Firefox (open snake.xhtml, press key, close the browser) then the corresponding
snakes disappear. (Maybe Chrome does not send some "Close Websocket" message before closing/aborting
the TCP connection.)

When I do this a few times, then eventually when I open snake.xhtml in Chrome, it will only
display "Info: WebSocket closed." (and no snakes are visible), and Tomcat prints following
exceptions:

01-Oct-2013 23:16:00.340 SEVERE [http-apr-8080-exec-1] org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError
No error handling configured for [websocket.snake.SnakeAnnotation] and the following error
occurred
 java.io.IOException: java.util.concurrent.ExecutionException: java.io.EOFException
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:226)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:474)
	at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:438)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:172)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$200(WsHttpUpgradeHandler.java:45)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:194)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:169)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:638)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:282)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2399)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2388)
	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:724)
Caused by: java.util.concurrent.ExecutionException: java.io.EOFException
	at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:222)
	... 14 more
Caused by: java.io.EOFException
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doClose(WsRemoteEndpointImplServer.java:121)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.close(WsRemoteEndpointImplBase.java:536)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:102)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:71)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:358)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:259)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:217)
	... 14 more


Rarely then I also get the following exception in SnakeTimer.broadcast(String message), but
this is probably caused by a concurrency issue (e.g. if the timer starts to loop over the
snakes to send some messages, but at the same time one of the websocket connections has been
closed which is handled by another thread):

01-Oct-2013 23:16:00.346 SEVERE [SnakeTimer Timer] websocket.snake.SnakeTimer$1.run Caught
to prevent timer from shutting down
 java.lang.IllegalStateException: Message will not be sent because the WebSocket session has
been closed
[...]


If I try the same with the NIO connector, then the behavior is different: The corresponding
snake disappears if I close Chrome, and each time I close Chrome I immediately get the exception
(but not if I close Firefox or IE):

01-Oct-2013 23:24:02.589 SEVERE [http-nio-8080-exec-1] org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError
No error handling configured for [websocket.snake.SnakeAnnotation] and the following error
occurred
 java.io.IOException: java.util.concurrent.ExecutionException: java.io.EOFException
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:226)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:474)
	at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:438)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:172)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$200(WsHttpUpgradeHandler.java:45)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:198)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:169)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:638)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1618)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1576)
	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:724)
Caused by: java.util.concurrent.ExecutionException: java.io.EOFException
	at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:222)
	... 14 more
Caused by: java.io.EOFException
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doClose(WsRemoteEndpointImplServer.java:121)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.close(WsRemoteEndpointImplBase.java:536)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:102)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:71)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:358)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:259)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:217)
	... 14 more


>From what I read from the exceptions, I think that these exceptions themselves are OK
since the connection closed abnormally and no Error handling is configured - but it seems
that the APR connector does not handle the connection abort correctly.

The behavior with 8.0.0-RC1 seems to be the same.


Regards,
Konstantin Preißer


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


Mime
View raw message