thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King III (JIRA)" <>
Subject [jira] [Updated] (THRIFT-4469) isServing is not thread safe
Date Thu, 03 Jan 2019 00:29:00 GMT


James E. King III updated THRIFT-4469:
    Affects Version/s:     (was: 1.0)

> isServing is not thread safe
> ----------------------------
>                 Key: THRIFT-4469
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9.3, 0.10.0, 0.11.0, 0.12.0
>            Reporter: Robert Joseph Evans
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
> 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

This message was sent by Atlassian JIRA

View raw message