Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9.3, 0.10.0, 0.11.0, 0.12.0
Description
We have some integration tests in storm were we create a TServer and call serve on it in a background thread, because it is a blocking call.
Then in the main thread we wait for up to 10 seconds for isServing to return success with a 100ms sleep in between each call.
I don't know if this is a java bug or what, but in some not so rare cases isServing does not return true during the entire 10 seconds and the test fails. The test prints out a stack trace when this happens and the background thread running the server is always at
happily serving.
So either we got very unlucky many times and it takes just a few ms longer than 10 seconds to come up some times, and < 1 sec other times, or java is doing something strange some of the time, and because Server.isServing is not volatile the checking thread caches a copy of it in a register and never updates it during the 10 seconds of the test run.
Even if it is a java bug, which I could argue probably is, it would be good to make isServing volatile.
Attachments
Issue Links
- links to