Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
We observed sporadic errors [1] fir the project core-its on Jenkins.
So I started haveing a look and I say the JavaDoc of the method getlocalPort saying that -1 is returned if the connector is not open. So I decided to use [2] and wait until the server is up. This was of course wrong because the status of the server is set to STARTED immediatelly after the method Server.start(). So therefore I was googling a little bit and I found that Hadoop [3] had this problem too in 2010. Whole problem was with a bug in Jetty server which is race condition. The article has a link to Jetty's Jira with reported bug JETTY-748. According to the annoucements [4] from Eclipse/Jetty, the bug "JETTY-748 Prevent race close of socket by old acceptor threads" was fixed in the version jetty-7.2.1.v20101111. So I decided to use that version but I found that the class HashUserRealm was deleted and there is no support and no further development of org.mortbay. Eclipse continues with the development of Jerry 9.
All I did in this issue was to rewrite 38 integration tests to Jetty 9 API and the fix for JETTY-748 is right there.
[1]:
Error message in logs: [WARNING] Could not transfer metadata org.apache.maven.its.mng4554/maven-metadata.xml from/to central (http://localhost:-1/repo-1): Connect to localhost:80 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
[2]:
while ( !server.isRunning() || !server.isStarted() ) { if ( server.isFailed() ) { fail( "Couldn't bind the server socket to a free port!" ); } Thread.sleep( 100L ); }
Attachments
Issue Links
- links to