Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore conflict while removing container #702

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Ignore conflict while removing container #702

merged 1 commit into from
Dec 14, 2018

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Dec 5, 2018

In some circumstances we try to remove docker container while it is still being terminated. Seems such a race condition can happen with pipelines as we detect both Pipeline job and PlaceholderTask completion.

PlaceholderExecutable:ExecutorStepExecution.PlaceholderTask{runId=CompileTest#22494,label=docker-2ae12755b
75761,context=CpsStepContext[4:node]:Owner[CompileTest/22494:CompileTest #22494],cookie=561ba1da-fd51-4ee6-9bc3-5d4bb75a9fd0,auth=null} seems to be finished
...

2018-11-15 14:00:06.624+0000 [id=2063173]       FINE    c.n.j.p.d.s.DockerOnceRetentionStrategy#done: terminating docker-2ae12755b75761 since CompileTestTest #544 seems to be finished
2018-11-15 14:00:06.625+0000 [id=2063198]       INFO    i.j.docker.DockerTransientNode$1#println: Disconnected computer for slave 'docker-2ae12755b75761'.
2018-11-15 14:00:06.625+0000 [id=2063198]       INFO    i.j.docker.DockerTransientNode$1#println: Removed Node for slave 'docker-2ae12755b75761'.
2018-11-15 14:00:07.005+0000 [id=2062533]       INFO    i.j.docker.DockerTransientNode$1#println: Stopped container '056930a8ce961fabcd357f7c349c36aad55242075a9af838b963c4b27fddc4e9' for slave 'docker-2ae12755b75761'.
2018-11-15 14:00:07.005+0000 [id=2063233]       INFO    i.j.docker.DockerTransientNode$1#println: Stopped container '056930a8ce961fabcd357f7c349c36aad55242075a9af838b963c4b27fddc4e9' for slave 'docker-2ae12755b75761'.
2018-11-15 14:00:07.011+0000 [id=2062533]       SEVERE  i.j.docker.DockerTransientNode$1#error: Failed to remove container '056930a8ce961fabcd357f7c349c36aad55242075a9af838b963c4b27fddc4e9' for slave 'docker-2ae12755b75761' due to exception:
com.github.dockerjava.api.exception.ConflictException: {"message":"removal of container 056930a8ce961fabcd357f7c349c36aad55242075a9af838b963c4b27fddc4e9 is already in progress"}

Not sure about the root cause for this, but at least we can ignore conflict in container removal to avoid spamming the logs

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@pjdarton pjdarton merged commit 091d317 into jenkinsci:master Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants