[1.1] runc list: fix race with runc delete
This is a backport of #3349 to release-1.1. Original description follows.
It is possible that parallel execution of runc list with runc delete will result in runc list fatal failure. Fix this.
Bonus: some refactoring.
Please review with --ignore-all-space ("Hide whitespace" checked on GH).
I think we should also change the go version to 1.21 in github workflow definition file because of #4193. But I'm curious about why there is no failure in the main branch.
Setup go version spec 1.x
Found in cache @ /opt/hostedtoolcache/go/1.22.1/x64
Added go to the path
Successfully set up Go version 1.x
/opt/hostedtoolcache/go/1.22.1/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.22.1/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Cache is not found
go version go1.22.1 linux/amd64
I think we should also change the go version to 1.21 in github workflow definition file because of #4193.
Yes, done.
But I'm curious about why there is no failure in the main branch.
I see that for cross-386 job we use Ubuntu 22.04 in main and 20.04 here, plus we only run unit tests (for some reason unit tests do not fail in 22.04 with Go 1.22, I guess we use nsenter in a slightly different manner).
Hmm.
I see that for cross-386 job we use Ubuntu 22.04 in main and 20.04 here, plus we only run unit tests (for some reason unit tests do not fail in 22.04 with Go 1.22, I guess we use nsenter in a slightly different manner).
Ah, nevermind, Ubuntu 22.04 fails for different reason (spec validator test, see here) and its glibc seems to be fine wrt Go 1.22 issue.
Please see https://github.com/opencontainers/runc/pull/4193/commits/6fb24a2460e0ccadb44cc4dacec6aff2f5d7ec75 in #4193 , I think maybe we can resolve this clone(2) issue. Please help to see what's wrong with the remain failure test cases.
we look forward to use this PR once it is included in the release in minikube, currently causing integration test failures