Bug 45279 - McastServiceImpl leaks sockets.
McastServiceImpl leaks sockets.
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
PC Linux
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2008-06-25 12:21 UTC by Robert Newson
Modified: 2009-07-01 12:31 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Robert Newson 2008-06-25 12:21:15 UTC
McastServiceImpl does not close its socket in stop() as it claims. It merely calls leaveGroup(), which is sufficient to stop receiving messages, but does not close the socket. 

This causes a file descriptor leak each time the service is stopped.



after leaveGroup();
Comment 1 Robert Newson 2008-06-25 13:13:34 UTC
btw, since it unreferences the socket without closing it, the next start() makes a new socket anyway.

I've hacked around this by using reflection to grab the reference to the multicast socket object before calling stop, then calling stop, then closing the socket myself.

Comment 2 Filip Hanik 2008-06-25 13:48:05 UTC
Fix suggested for back port into 6.0 branch
Comment 3 Filip Hanik 2008-06-30 13:03:21 UTC
Fixed in 6.0.x branch, will be included in 6.0.17 and forward

Comment 4 Rainer Jung 2009-07-01 12:31:52 UTC
Also applied to TC 5.5 as r790337.
Will be part of 5.5.28.