[release/1.2 backport] Fix container pid race condition#4025
[release/1.2 backport] Fix container pid race condition#4025fuweid merged 1 commit intocontainerd:release/1.2from
Conversation
|
Probably you mean to say "Closes: #4023 ([v1.2] regression in v1.2.12 leaves container/shim hanging)" in the PR description? |
|
That line is further down below in the description (fixes #4023 ...) |
|
Hm.. I was afraid that would happen; I suspect we need #3417 to fix that, or make some changes to the test Updating the test looks trivial, so let me go for that approach: diff --git a/container_test.go b/container_test.go
index 2a0828f4c..aa04a31ad 100644
--- a/container_test.go
+++ b/container_test.go
@@ -1540,7 +1540,7 @@ func TestShortRunningTaskPid(t *testing.T) {
var (
image Image
- ctx, cancel = testContext(t)
+ ctx, cancel = testContext()
id = t.Name()
)
defer cancel() |
622b91e to
710007a
Compare
|
Looks like there's failures with |
|
@thaJeztah I think I have the same failures in #4015, so at least seems unrelated to the fix. |
|
Thanks! Wasn't sure if it's related |
runtime/v1/linux/proc/init.go
Outdated
There was a problem hiding this comment.
I think we can keep safePid to prevent pid's data race and just remove StoppedPID and update kill logic. WDYT?
There was a problem hiding this comment.
This is a backport, so if we want to change that, it's better to make those changes on master, then backport to release branches
|
CI failure will be fixed by kubernetes-sigs/cri-tools#574 |
But cri-tools is pinned at v1.12.0 containerd/script/setup/install-critools Lines 24 to 27 in 35bd7a5 Not sure why the test result differs over time. |
@zhsj yes. I think the kubernetes-sigs/cri-tools package is always pulled in the machine. That is why that commit change doesn't work and it still using master. |
|
AppVeyor is failing now; could be a Windows issue (we've seen issues with latest Windows patch releases in moby/moby) |
710007a to
88e633f
Compare
Signed-off-by: Lantao Liu <lantaol@google.com> (cherry picked from commit a6b6097) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
88e633f to
b970987
Compare
Codecov Report
@@ Coverage Diff @@
## release/1.2 #4025 +/- ##
============================================
Coverage 44.19% 44.19%
============================================
Files 100 100
Lines 10847 10847
============================================
Hits 4794 4794
Misses 5313 5313
Partials 740 740
Continue to review full report at Codecov.
|
|
Yay, green now! |
The thirteenth patch release for `containerd` 1.2 fixes a regression introduced in v1.2.12 that caused container/shim to hang on single core machines, fixes an issue with blkio, and updates the Golang runtime to 1.12.17. Notable Updates ---------------------------------- * Fix container pid race condition [containerd#4025](containerd#4025) * Update containerd/cgroups dependency to address blkio issue [containerd#4001](containerd#4001) * Set octet-stream content-type on PUT request [containerd#4028](containerd#4028) * Pin to libseccomp 2.3.3 to preserve compatibility with hosts that do not have libseccomp 2.4 or higher installed [containerd#4015](containerd#4015) * Update Golang runtime to 1.12.17, which includes a fix to the runtime [containerd#4031](containerd#4031) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
alternative for #4024 ([1.2] Revert #3366)
closes #4024 ([1.2] Revert #3366)
backport of:
a6b6097 Fix container pid race condition. #3857 Fix container pid race condition
Minor conflict in
container_test.go, because Handle large output in v2 shim with TTY #3743 and Shorten the unix socket path for shim #3046 are not yet backported to the 1.2 branchConflict in
runtime/v1/linux/proc/utils.go``, because files were renamed, and theStoppedPID` const is in a different location;Resolved by removing the
StoppedPIDconst fromruntime/v1/linux/proc/process.goinstead ofpkg/process/utils.goAlso had to make a small modification to the test, because #3417 is not in the 1.2 branch;