Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346998

Summary: AbstractLifeCycle.isRunning() returns false if state changes from STARTING to STARTED during call
Product: [RT] Jetty Reporter: Michael Gorovoy <mgorovoy>
Component: serverAssignee: Michael Gorovoy <mgorovoy>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: 7.4.1   
Target Milestone: 7.2.x   
Hardware: PC   
OS: Linux   
URL: http://jira.codehaus.org/browse/JETTY-1316
Whiteboard:

Description Michael Gorovoy CLA 2011-05-24 11:09:40 EDT
This issue was originally reported as JETTY-1316 in Codehaus JIRA for Jetty 6.1 by Dave Messink (dmessink@umich.edu).

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.
Comment 1 Michael Gorovoy CLA 2011-05-24 22:36:39 EDT
Committed r3251.