Details
-
Bug
-
Resolution: Done
-
Minor
-
None
-
None
-
None
-
NEW
-
NEW
Description
If `terminateEarly` is called from two separate threads when SOLVING_SCHEDULED, it is possible for two threads to be in solvingTerminated at once, which allows this sequence of events:
- Thread 1, Thread 2 are in solvingTerminated
- Thread 1 unregister the solver job, which allows a new solver job to be created with the same Problem Id
- Thread 3 creates a new SolverJob with the same Problem Id
- Thread 2 unregister the solver job
Now Thread 3 have a SolverJob with a given problemId (that is either SOLVING_SCHEDULED or SOLVING), yet solverManager.getSolverStatus(problemId) == NOT_SOLVING. This allows for another SolverJob to be created with the same problemId, that can be cancelled via the SolverJob Thread 3 has.
The race condition is extremely hard to trigger.