Mark Thomas wrote:
> On 04/04/2012 17:02, Ofer Israeli wrote:
>> Hi all,
>> 
>> We have recently witnessed a strange situation.  Our Tomcat (6.0.35)
>> listens on 2 ports: 8080 and 8009, handling HTTP and AJP
>> respectively. At some point in time we found that Apache is replying
>> HTTP 503s to all clients and a look at netstat showed that indeed
>> Apache could not communicate with Tomcat - there were many
>> connections in state SYN_SENT, that were never replied.  A test of
>> attempting to connect to Tomcat's 8009 port turned out to give the
>> same result, so the issue was obviously in Tomcat and not Apache.
>> But netstat also showed that Tomcat was listening on port 8009.
>> After digging into the logs, we found that there was an Out of Memory
>> exception in the JK's accept() sequence and once this exception was
>> caught there was a message of "terminating thread".
>> 
>> So although the exception is caught and handled by killing the thread
>> (isn't that a little drastic?), the socket isn't closed beforehand
>> and thus the OS thinks that the port is still fine (in LISTENING
>> state), as although the thread is dead, the process is alive.  Has
>> anyone encountered this or knows if this bug is known?
> 
> Once you have an OOME all bets are off. The JVM needs to be restarted.
> There is no guarantee of reliable operation after an OOME.
> 
> Mark

Hi Mark,
I agree that there in such a situation the JVM should be restarted, but it 
isn't restarted by Tomcat.  On the other hand, Tomcat does take some 
precautious actions and kills the accepting thread, but in such a case it 
should also close the socket that thread is listening on otherwise it is 
leaving garbage around after the thread's death.
Do you see any reason as not to close the listening socket?

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

Reply via email to