tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wesley Hall" <wesley.h...@prociss.co.uk>
Subject Bug Report - 4.1.27 Race Condition
Date Mon, 11 Aug 2003 16:30:18 GMT
Hello,

I have found a small bug during my work embedding the tomcat server into our
application.

When a secure connector is added to an instance of Embedded, and embedded is
startd and stopped several times in quick succession (which is part of our
test framework) a race condition occurs.

Sometimes i am presented with an exception with a root cause of...

Caused by: LifecycleException: Coyote connector has not been started
at org.apache.coyote.tomcat4.CoyoteConnector.stop(CoyoteConnector.java:1199)
at org.apache.catalina.startup.Embedded.stop(Embedded.java:1030)

(NOTE: This exception is thrown after a call to the start method of Embedded
has been made and connectors added)

Other times the test is successful. Sometimes (although a little more rare
than these two outcomes), I recieve an 'Address already in use', which seems
to be the inverse of the exception above, and occurs on a call to start()
after a stop() has already been made.

Placing a Thread.sleep(x) between start/stop attempts seems to increase the
likelyhood of the test being successful and increasing the interval increase
the percentage of successful test runs until upon reaching an interval of
75ms the success rate becomes 100%.

It seems there is a race condition in starting up or shutting down of
Embedded vs The secure connector. Sometimes Embedded.start() will return
before the connector has been started and the same with Embedded.stop().
Unfortunatly, i cannot seem to locate the Coyote source to verify this.

Presumably, this issue is pretty minor as the only circumstance i can see
where someone will be running stops and starts in quick succession is a
contrived test case, but i thought i would bring it to your attention
anyway.

Regards

Wesley I. Hall

P.S. If Mr Bill Barker is reading this, your advice on my https problem
worked like a charm. I owe you a beer! =o)




Mime
View raw message