Potential race between ConnectionValidator and ConnectionListener upon connection failure
-----------------------------------------------------------------------------------------
Key: JBREM-1112
URL:
https://jira.jboss.org/jira/browse/JBREM-1112
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.2.2.SP11, 2.5.0.SP2 (Flounder)
Reporter: Ron Sigal
Assignee: Ron Sigal
Fix For: 2.5.0.SP3 (Flounder), 2.2.2.SP12
When org.jboss.remoting.ConnectionValidator.WaitOnConnectionCheckTimerTask detects a
connection failure, it informs all registered ConnectionListeners and then, if the
parameter "stopLeaseOnFailure" is set to "true", it calls
invoker.terminateLease(null, client.getDisconnectTimeout());
The idea is that a ConnectionListener might want to set the Client's disconnectTimeout
value to limit the time spent on network i/o while shutting down a faulty connection. In
particular, if disconectTimeout is set to 0, then Remoting will skip any i/o while
shutting down a connection.
The problem is that, in ConnectionValidator.notifyListeners(), each registered
ConnectionListener is called in a separate thread, to avoid getting hung up in a
particular ConnectionListener. As a result, it is possible for ConnectionValidator to
call Client.getDisconnectTImeout() before any ConnectionListener gets a chance to call
Client.setDisconnectTimeout().
In particular, this race has been discovered in the context of a JBossMessaging
application.
--
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