From b755a1c60b6235e3a57def2361c5afe8232d1386 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 19 Aug 2024 13:51:56 +0200 Subject: [PATCH] vendor: update go-criu to latest There is no new version yet but we like to use the new code[1] to debug a flake[2] in the podman CI. It will not fix it but the new error might give us a better idea what is going on. [1] https://github.com/checkpoint-restore/go-criu/pull/175 [2] https://github.com/containers/podman/issues/18856 Signed-off-by: Paul Holzinger --- go.mod | 2 +- go.sum | 4 ++-- .../checkpoint-restore/go-criu/v7/.gitignore | 1 + .../checkpoint-restore/go-criu/v7/Makefile | 5 +--- .../checkpoint-restore/go-criu/v7/main.go | 24 +++++++++++++------ vendor/modules.txt | 4 ++-- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 5949a8983f..8f5e06debe 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/blang/semver/v4 v4.0.0 github.com/buger/goterm v1.0.4 github.com/checkpoint-restore/checkpointctl v1.2.1 - github.com/checkpoint-restore/go-criu/v7 v7.1.0 + github.com/checkpoint-restore/go-criu/v7 v7.1.1-0.20240728160228-a9064d7e053c github.com/containernetworking/plugins v1.5.1 github.com/containers/buildah v1.37.0 github.com/containers/common v0.60.1-0.20240808214705-d93f74f43223 diff --git a/go.sum b/go.sum index 109d5409c8..d436a7396c 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/checkpointctl v1.2.1 h1:aYFl2CEk95bPLDvNDgif4ZLx3pjCZMJm6td+A0X1+xs= github.com/checkpoint-restore/checkpointctl v1.2.1/go.mod h1:8oF+AtNUFJAI13ETcbB3clnjiwvviX0QzVBhYzQ8yBA= -github.com/checkpoint-restore/go-criu/v7 v7.1.0 h1:JbQyO4o+P8ycNTMLPiiDqXg49bAcy4WljWCzYQho35A= -github.com/checkpoint-restore/go-criu/v7 v7.1.0/go.mod h1:1svAtmbtvX4BKI45OFzgoTTLG7oYFKdColv/Vcsb2A8= +github.com/checkpoint-restore/go-criu/v7 v7.1.1-0.20240728160228-a9064d7e053c h1:/LNWuEZICKO96wvlLRam53lp7inbzwR1zE/YuoUUV/k= +github.com/checkpoint-restore/go-criu/v7 v7.1.1-0.20240728160228-a9064d7e053c/go.mod h1:FTB8VSlcpwignNNaAXXzNlKBIf+DcZw8urnXKCkpeB4= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= diff --git a/vendor/github.com/checkpoint-restore/go-criu/v7/.gitignore b/vendor/github.com/checkpoint-restore/go-criu/v7/.gitignore index d8b4f7401a..eb1b08bc47 100644 --- a/vendor/github.com/checkpoint-restore/go-criu/v7/.gitignore +++ b/vendor/github.com/checkpoint-restore/go-criu/v7/.gitignore @@ -15,3 +15,4 @@ scripts/magic-gen/expected.go scripts/magic-gen/output.go crit/bin crit/test-imgs/ +__pycache__ diff --git a/vendor/github.com/checkpoint-restore/go-criu/v7/Makefile b/vendor/github.com/checkpoint-restore/go-criu/v7/Makefile index 6aacde06e1..12e064237a 100644 --- a/vendor/github.com/checkpoint-restore/go-criu/v7/Makefile +++ b/vendor/github.com/checkpoint-restore/go-criu/v7/Makefile @@ -18,9 +18,6 @@ test: build coverage: $(MAKE) -C test coverage -codecov: - $(MAKE) -C test codecov - rpc/rpc.proto: curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/rpc.proto -o $@ @@ -42,4 +39,4 @@ clean: $(MAKE) -C crit/ clean $(MAKE) -C test/ clean -.PHONY: build test lint vendor coverage codecov clean +.PHONY: build test lint vendor coverage clean diff --git a/vendor/github.com/checkpoint-restore/go-criu/v7/main.go b/vendor/github.com/checkpoint-restore/go-criu/v7/main.go index 6906c9811a..8f29d2ee2d 100644 --- a/vendor/github.com/checkpoint-restore/go-criu/v7/main.go +++ b/vendor/github.com/checkpoint-restore/go-criu/v7/main.go @@ -61,13 +61,19 @@ func (c *Criu) Prepare() error { } // Cleanup cleans up -func (c *Criu) Cleanup() { +func (c *Criu) Cleanup() error { + var errs []error if c.swrkCmd != nil { - c.swrkSk.Close() + if err := c.swrkSk.Close(); err != nil { + errs = append(errs, err) + } c.swrkSk = nil - _ = c.swrkCmd.Wait() + if err := c.swrkCmd.Wait(); err != nil { + errs = append(errs, fmt.Errorf("criu swrk failed: %w", err)) + } c.swrkCmd = nil } + return errors.Join(errs...) } func (c *Criu) sendAndRecv(reqB []byte) ([]byte, int, error) { @@ -99,9 +105,7 @@ func (c *Criu) doSwrk(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify) e return nil } -func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (*rpc.CriuResp, error) { - var resp *rpc.CriuResp - +func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (resp *rpc.CriuResp, retErr error) { req := rpc.CriuReq{ Type: &reqType, Opts: opts, @@ -121,7 +125,13 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N return nil, err } - defer c.Cleanup() + defer func() { + // append any cleanup errors to the returned error + err := c.Cleanup() + if err != nil { + retErr = errors.Join(retErr, err) + } + }() } for { diff --git a/vendor/modules.txt b/vendor/modules.txt index 9836fb6755..410210a76c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -89,8 +89,8 @@ github.com/bytedance/sonic/utf8 # github.com/checkpoint-restore/checkpointctl v1.2.1 ## explicit; go 1.21 github.com/checkpoint-restore/checkpointctl/lib -# github.com/checkpoint-restore/go-criu/v7 v7.1.0 -## explicit; go 1.18 +# github.com/checkpoint-restore/go-criu/v7 v7.1.1-0.20240728160228-a9064d7e053c +## explicit; go 1.20 github.com/checkpoint-restore/go-criu/v7 github.com/checkpoint-restore/go-criu/v7/rpc github.com/checkpoint-restore/go-criu/v7/stats