Bug 52729 - An incomplete fix for the resource leak bug in CometConnectionManagerValve.java
An incomplete fix for the resource leak bug in CometConnectionManagerValve.java
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
trunk
PC All
: P2 enhancement (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-02-21 12:01 UTC by lianggt08
Modified: 2012-03-06 21:27 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lianggt08 2012-02-21 12:01:25 UTC
The fix revision 640273 was aimed to remove an resource leak bug on the  CometEventImpl object "cometEvent " (created line 130) in the method "lifecycleEvent()" of the file "/tomcat/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java" , but it is incomplete. 

There are some problems: 
1. when the statements at lines 131-134 throw some exception, the "cometEvent" can not be closed as expected. 

The best way to close such resource objects is putting such close operations in the finaly block of a try-catch-finally structure.
Comment 1 Mark Thomas 2012-03-06 21:27:10 UTC
r640273 has nothing to do with fixing potential resource leaks.

If the end event fails, the chances of the close event working are pretty slim.

Given that this code is part of the shutdown, a resource leak at this point is a minor issue at best and is probably not an issue at all.

Yet another enhancement where the severity has been badly mis-judged.