[
https://jira.jboss.org/jira/browse/JBREM-1183?page=com.atlassian.jira.plu...
]
David Lloyd commented on JBREM-1183:
------------------------------------
The safest way to ensure that a resource is reclaimed in the event of an exception is to
use something like this:
boolean ok = false;
try {
...do sensitive operations...
ok = true;
} finally {
if (! ok) {
safeClose(resource);
}
}
where "safeClose" is a method which surrounds the appropriate cleanup task
(close in this case) with a try/catch (Throwable t) which logs t (it's never a good
idea to allow exceptions to be propagated from a finally block).
ServerThread should catch java.lang.Error
-----------------------------------------
Key: JBREM-1183
URL:
https://jira.jboss.org/jira/browse/JBREM-1183
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 2.2.3.SP1, 2.5.2.SP2 (Flounder)
Reporter: Ron Sigal
Assignee: Ron Sigal
Fix For: 2.5.2.SP3 (Flounder)
org.jboss.remoting.transport.socket.ServerThread.dorun() does not catch org.lang.Error,
so an Error causes it to terminate without closing its socket.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira