File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ func (state *DockerTaskEngineState) AddImageState(imageState *image.ImageState)
225
225
}
226
226
227
227
// RemoveTask removes a task from this state. It removes all containers and
228
- // other associated metadata. It does aquire the write lock.
228
+ // other associated metadata. It does acquire the write lock.
229
229
func (state * DockerTaskEngineState ) RemoveTask (task * api.Task ) {
230
230
state .lock .Lock ()
231
231
defer state .lock .Unlock ()
Original file line number Diff line number Diff line change @@ -507,16 +507,12 @@ func (mtask *managedTask) cleanupTask(taskStoppedDuration time.Duration) {
507
507
// For the duration of this, simply discard any task events; this ensures the
508
508
// speedy processing of other events for other tasks
509
509
handleCleanupDone := make (chan struct {})
510
- go func () {
511
- mtask .engine .sweepTask (mtask .Task )
512
- mtask .engine .state .RemoveTask (mtask .Task )
513
- handleCleanupDone <- struct {}{}
514
- }()
515
510
// discard events while the task is being removed from engine state
516
- mtask .discardEventsUntil (handleCleanupDone )
511
+ go mtask .discardEventsUntil (handleCleanupDone )
512
+ mtask .engine .sweepTask (mtask .Task )
513
+ mtask .engine .state .RemoveTask (mtask .Task )
517
514
log .Debug ("Finished removing task data; removing from state no longer managing" , "task" , mtask .Task )
518
515
// Now remove ourselves from the global state and cleanup channels
519
- go mtask .discardEventsUntil (handleCleanupDone ) // keep discarding events until the task is fully gone
520
516
mtask .engine .processTasks .Lock ()
521
517
delete (mtask .engine .managedTasks , mtask .Arn )
522
518
handleCleanupDone <- struct {}{}
You can’t perform that action at this time.
0 commit comments