Skip to content

Commit

Permalink
YOLO see if this works
Browse files Browse the repository at this point in the history
```
panic: Log in goroutine after TestWorkerUpdate has completed

goroutine 1175 [running]:
testing.(*common).logDepth(0xc00019a100, 0xc0000396a0, 0x1d, 0x3)
	/usr/local/go/src/testing/testing.go:634 +0x51a
testing.(*common).log(...)
	/usr/local/go/src/testing/testing.go:614
testing.(*common).Log(0xc00019a100, 0xc00006fb00, 0x1, 0x1)
	/usr/local/go/src/testing/testing.go:642 +0x79
github.com/docker/swarmkit/agent.(*mockTaskController).Remove(0xc00020a780, 0x13b6f40, 0xc0000b4010, 0x13b6f40, 0xc0000b4010)
	/home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker_test.go:604 +0x8e
github.com/docker/swarmkit/agent.reconcileTaskState.func1(0xc0004dac60)
	/home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker.go:270 +0x137
created by github.com/docker/swarmkit/agent.reconcileTaskState
	/home/circleci/.go_workspace/src/github.com/docker/swarmkit/agent/worker.go:313 +0x1a6f
FAIL	github.com/docker/swarmkit/agent	4.244s
make: *** [coverage] Error 1
Exited with code 2
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 42085d2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Sep 25, 2019
1 parent 771a7f5 commit 392fe36
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions agent/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,11 @@ func reconcileTaskState(ctx context.Context, w *worker, assignments []*api.Assig
}

closeManager := func(tm *taskManager) {
go func(tm *taskManager) {
defer w.closers.Done()
// when a task is no longer assigned, we shutdown the task manager
if err := tm.Close(); err != nil {
log.G(ctx).WithError(err).Error("error closing task manager")
}
}(tm)
defer w.closers.Done()
// when a task is no longer assigned, we shutdown the task manager
if err := tm.Close(); err != nil {
log.G(ctx).WithError(err).Error("error closing task manager")
}

// make an attempt at removing. this is best effort. any errors will be
// retried by the reaper later.
Expand Down

0 comments on commit 392fe36

Please sign in to comment.