On 09/10/2013 22:48, Konstantin Preißer wrote:

> Unfortunately, it seems there are some new problems when using the NIO 
> connector  :(

Not unfortunate at all. This is all very useful feedback.

> (though I do not think they affect a 8.0.0-RC4 release).
> I was testing the current trunk with NIO connector on Windows with 64-Bit 
> Java and I tried to open the Drawboard example and there press F5 for several 
> times on different computers.
> 
> 1) Sometimes I get following exceptions:
> 
> 09-Oct-2013 23:11:28.069 SEVERE [http-nio-8783-exec-8] 
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process Error 
> reading request, ignored
>  java.lang.IllegalStateException: Message will not be sent because the 
> WebSocket session has been closed
>       at 
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:292)

Fixed (purely on code inspection - I haven't tested this yet).

> 2) What is a bit more severe is that sometimes after pressing F5 a lot of 
> times, Firefox cannot establish a Websocket connection or make another HTTP 
> request to Tomcat.

That sounds like Firefox has reached its per server connection limit
which suggests Tomcat isn't closing connections properly on some error
condition(s).

> Then I also get such exceptions sporadically:
> 
> 09-Oct-2013 23:19:07.646 SEVERE [http-nio-8783-ClientPoller-0] 
> org.apache.tomcat.util.net.NioEndpoint.processSocket Error allocating socket 
> processor
>  java.lang.NullPointerException
>       at 
> org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:624)
>       at 
> org.apache.tomcat.util.net.NioEndpoint$Poller.processKey(NioEndpoint.java:1163)
>       at 
> org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1121)
>       at java.lang.Thread.run(Thread.java:724)

That looks like a closed socket hasn't been removed from the Poller.

> or these (which seems strange because there occurs a Timeout exception when 
> sending data, but I don't think Firefox would leave the connection open and 
> stop to read from it):
> 09-Oct-2013 23:14:57.453 SEVERE [http-nio-8783-exec-4] 
> websocket.drawboard.DrawboardEndpoint.onError onError: java.io.IOException: 
> java.util.concurrent.TimeoutException
>  java.io.IOException: java.util.concurrent.TimeoutException
>       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.WsFrameBase.processDataControl(WsFrameBase.java:316)
>       at 
> org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:270)
>       at 
> org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:116)
>       at 
> org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:55)
>       at 
> org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:192)
>       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:640)
>       at 
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
>       at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1595)
>       at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1553)
>       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.TimeoutException
>       at 
> org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:99)
>       at 
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:222)
>       ... 16 more

Hmm. That is timing out when trying to send a close message.

Overall, it looks like the connection isn't always closed cleanly when
F5 is pressed several times in quick succession. I'll take a look.

Mark


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

Reply via email to