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: svn commit: r1530081 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Date Thu, 10 Oct 2013 13:41:06 GMT
Hi Mark,

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Thursday, October 10, 2013 10:53 AM
> To: Tomcat Developers List
> Subject: Re: svn commit: r1530081 -
> /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
> 
> >> 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.
> 
> I can't reproduce this. It is possible that the fix for 1 also fixed
> this. Can you test?
> 
> What I did see was that with a lot of refreshes, Firefox ended up with
> two connections open when it should only have had one. Closing the
> browser fixed that.

Thanks.

Yes, I can still reproduce this on trunk with r1530937.

What I did was:
I started Tomcat on a server (connected over internet, not LAN, so the latency/speed is not
as good as in a LAN) and started Tomcat. Then, on two machines I opened the drawboard example
and drew something on it so that the PNG images gets big (about 500 KB). Then on both machines
I simultaneously pressed F5 (either holding it down for some seconds, or press it manually
when Firefox was in the middle of receiving the PNG image).
After some time where I stopped, the drawboard mentioned 3 connected players instead of 2.
Then I closed Firefox on machine A - it reported 2 players. I reopened firefox - 3 players.
Then I closed Firefox on machine B - still 2 players. I reopened Firefox on machine B - then
it tried to establish a new websocket connection (the .xhtml page was probably loaded from
the cache), but after 5 seconds, it displayed "Websocket closed" so it couldn't establish
a new connection - at the same time on the other machine the player count went down to 1.
Then, on machine B I pressed F5 again, but now Firefox couldn't even load the .xhtml page,
and on Tomcat the NPE showed up again:

10-Oct-2013 15:05:49.249 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)

(and as I'm writing this, Firefox still seems to wait for a reply from Tomcat.

After that I have pressed ESC to abort loading and pressed F5 again, but still no new websocket
connection.

Then I took my TCP forwarder tool to see what data is actually sent on the TCP connections
from and to Tomcat. This is what happened:
1) Firefox opened Connection 1 and sent "GET /examples/websocket/drawboard.xhtml HTTP/1.1"
request to Tomcat.
2) On Connection 1, Tomcat replied with a correct reply with the contents of the drawboard.xhtml
file.
3) On Connection 1, Firefox sent "GET /favicon.ico HTTP/1.1" request to Tomcat.
4) Firefox established two new TCP connections (3 and 4) to Tomcat.
5) On Connection 1, Tomcat replied with the correct contents of "favicon.ico".
6) On Connection 2, Firefox sends "GET /examples/websocket/drawboard HTTP/1.1" request to
Tomcat with WebSocket headers to open the WebSocket connection.
7) Nothing happens.
8) After some time Firefox half-closed connections 1 and 3, and Tomcat full-closed them.
9) I shutdown Firefox so connection 2 was half-closed by the Client, but Tomcat did not full-close
it so it is still active on the TCP forwarder.

Then I killed the TCP forwarder and opened it and Firefox again, but this time Tomcat even
did not response on the "GET /examples/websocket/drawboard.xhtml HTTP/1.1" request. After
I closed Firefox, then again the connection where that request was sent was still hold open
by Tomcat. After some minutes, the forwarder received a Timeout error on the TCP connection
that was still held open by Tomcat (SocketError: TimedOut (10060)).


Hope this helps,

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