-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
If we stop a runner without waiting for the theard to terminate (join_timeout=0, staring it again might create another thread:
- Start the runner. This runs thread T1: running=true
- Stop the runner, don't join t1: running=false. T1 might be doing some longer work, therefore doesn't react to the interrupt
- Start the runner again. As thread was nulled, we create a new runner thread T2 -> we now have 2 threads running. T1 will not terminate if it swallowed the InterruptedException and running is true
This is a typical A-B-A problem. It could be fixed by using an AtomicInteger variable with states STOPPED (0) -> RUNNING (2) -> STOPPING (1), and atomically moving between states.
Note that this is currently not a major issue, as runners are typically started when a protocol is started, and stopped when the protocol is stopped. Also, thread interruption works in most cases.
This JIRA only aims to harden Runner.