Fix task load.#2151
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2151 +/- ##
=======================================
Coverage 45.41% 45.41%
=======================================
Files 82 82
Lines 8749 8749
=======================================
Hits 3973 3973
Misses 4130 4130
Partials 646 646
Continue to review full report at Codecov.
|
|
What about calling close after |
That is an option, too. It depends on how we define the order. |
Well, it's a temp directory, a new one is created everytime. I'm on the position to delete the resources only once the task is actually gone. Especially since we assume those resources are there on attach. |
|
I don't think we should have the diff --git a/task.go b/task.go
index 68308b62..5ee36337 100644
--- a/task.go
+++ b/task.go
@@ -267,7 +267,6 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat
if t.io != nil {
t.io.Cancel()
t.io.Wait()
- t.io.Close()
}
r, err := t.client.TaskService().Delete(ctx, &tasks.DeleteTaskRequest{
ContainerID: t.id,
@@ -275,6 +274,10 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat
if err != nil {
return nil, errdefs.FromGRPC(err)
}
+ // Only close the IO after a successful Delete
+ if t.io != nil {
+ t.io.Close()
+ }
return &ExitStatus{code: r.ExitStatus, exitedAt: r.ExitedAt}, nil
} |
|
@dnephin OK. Will do so. :) |
afb3f39 to
0b4bf8d
Compare
|
Done |
There was a problem hiding this comment.
nit: s/close/cleanup ?
If it was just closing the IO it wouldn't need to be done so late after a Cancel/Wait combo.
0b4bf8d to
c72039e
Compare
|
The test failure seems like something wrong with golang 1.10 to me: It does equal, even the tailing |
|
Hm, it constantly fails with golang 1.10... |
|
golang 1.10 has a bug... I'll file an issue and send a PR. |
|
This is a golang 1.10 bug, see:
Let's not use golang 1.10 for now... This bug is really easy to hit... |
|
This turns out to be a race condition exposed in golang 1.10. Send out a fix for cri-tools kubernetes-sigs/cri-tools#257. Will update cri-tools as soon as that is fixed to unblock the submit queue. |
0c55cff to
c72039e
Compare
|
Rebase now that the other PR is merged? |
|
Will do now. |
Signed-off-by: Lantao Liu <[email protected]>
c72039e to
4ac4fd0
Compare
|
@crosbymichael Done. |
|
Seems like another race condition for concurrent image pull. |
|
LGTM |
Fixes #2150.
Option 3 of #2150.
Signed-off-by: Lantao Liu [email protected]