Opened 5 years ago

Closed 5 years ago

#1878 closed defect (done)

Executing optimizers in experiments concurrently can lead to exceptions and even a crash

Reported by: gkronber Owned by: gkronber
Priority: high Milestone: HeuristicLab 3.3.7
Component: Optimization Version: 3.3.7
Keywords: Cc:

Description (last modified by gkronber)

A race condition can occur in the optimizer_Stopped event handler in Experiment when multiple optimizers stop at the same time. Because then the same optimizer (prepared-state) could be chosen as next optimizer by both threads, which then leads to an exception because a running optimizer cannot be started again.

Change History (12)

comment:1 Changed 5 years ago by gkronber

  • Description modified (diff)

comment:2 Changed 5 years ago by mkommend

I also had a look at this issue. You are right with the found race condition and to eliminate it we should just lock the affected parts.

comment:3 Changed 5 years ago by gkronber

  • Owner changed from swagner to gkronber
  • Status changed from new to assigned

comment:4 Changed 5 years ago by mkommend

  • Owner changed from gkronber to mkommend
  • Status changed from assigned to accepted

comment:5 Changed 5 years ago by mkommend

r8129: Added lock statement in Experiment.optimizer_Stopped to avoid a race condition.

comment:6 Changed 5 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from accepted to reviewing

comment:7 Changed 5 years ago by mkommend

r8136: Forgot to initialize lock object.

comment:8 Changed 5 years ago by gkronber

  • Status changed from reviewing to assigned

comment:9 Changed 5 years ago by gkronber

r8170: added synchronization to all event handlers for optimizer events in the Experiment

comment:10 Changed 5 years ago by gkronber

  • Owner changed from gkronber to mkommend
  • Status changed from assigned to reviewing

Tested a large experiment and didn't find any problems.

comment:11 Changed 5 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from reviewing to readytorelease

comment:12 Changed 5 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed
  • Version changed from 3.3.6 to 3.3.7
Note: See TracTickets for help on using tickets.