Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 6.1.24
-
Fix Version/s: 6.1.27
-
Component/s: None
-
Labels:None
-
Environment:Any - but we discovered it on a Linux box
-
Number of attachments :
Description
The current implementation of AbstractLifeCycle.isRunning() may return false if the state of the component changes from STARTING to STARTED during the call.
This was discovered when the SelectChannelConnector.doStart() starts an acceptor thread - which fails to enter the accept loop due to isRunning() returning false. We narrowed it down to the main thread changing the state of the lifecycle immediately after spawning the thread - which causes the comparison checks in isRunning() to fail. (This happens one out of 300 attempts. Yes - it's rare but was happening enough to cause nightly integration tests to fail).
We've worked around the issue by extending the SelectChannelConnector class and overriding the isRunning() method.
Activity
Michael Gorovoy
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Michael Gorovoy [ mgorovoy ] |
Michael Gorovoy
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 6.1.27 [ 17238 ] | |
| Resolution | Fixed [ 1 ] |
Someone suggested that I include my patch. I'd morph the AbstractLifeCycle.isRunning() method as follows:
public boolean isRunning()
{ final int state = _state; return state == STARTING || state == STARTED; }