Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346998 - AbstractLifeCycle.isRunning() returns false if state changes from STARTING to STARTED during call
Summary: AbstractLifeCycle.isRunning() returns false if state changes from STARTING to...
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Michael Gorovoy CLA
QA Contact:
URL: http://jira.codehaus.org/browse/JETTY...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 11:09 EDT by Michael Gorovoy CLA
Modified: 2011-05-24 22:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.