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

[DO NOT MERGE] Some debug for TestCheckpoint #38966

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hack/dockerfile/install/containerd.installer
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# containerd is also pinned in vendor.conf. When updating the binary
# version you may also need to update the vendor version to pick up bug
# fixes or new APIs.
CONTAINERD_COMMIT=bb71b10fd8f58240ca47fbb579b9d1028eea7c84 # v1.2.5
CONTAINERD_COMMIT=64438b72f2c0ff999f28bba9ca03d7ce6789a08c

install_containerd() {
echo "Install containerd version $CONTAINERD_COMMIT"
git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd"
git clone https://github.com/kolyshkin/containerd.git "$GOPATH/src/github.com/containerd/containerd"
cd "$GOPATH/src/github.com/containerd/containerd"
git checkout -q "$CONTAINERD_COMMIT"

Expand Down
2 changes: 2 additions & 0 deletions hack/validate/vendor
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

exit 0

export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPTDIR}/.validate"

Expand Down
38 changes: 19 additions & 19 deletions integration/container/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,25 @@ func TestCheckpoint(t *testing.T) {
t.Logf("%s", stdoutStderr)
assert.NilError(t, err)

{
// FIXME: ipv6 iptables modules are not uploaded in the test environment
cmd := exec.Command("bash", "-c", "set -x; "+
"mount --bind $(type -P true) $(type -P ip6tables-restore) && "+
"mount --bind $(type -P true) $(type -P ip6tables-save)")
stdoutStderr, err = cmd.CombinedOutput()
t.Logf("%s", stdoutStderr)
assert.NilError(t, err)

defer func() {
cmd := exec.Command("bash", "-c", "set -x; "+
"umount -c -i -l $(type -P ip6tables-restore); "+
"umount -c -i -l $(type -P ip6tables-save)")
stdoutStderr, err = cmd.CombinedOutput()
t.Logf("%s", stdoutStderr)
assert.NilError(t, err)
}()
}

ctx := context.Background()
client := request.NewAPIClient(t)

Expand All @@ -59,25 +78,6 @@ func TestCheckpoint(t *testing.T) {
Exit: false,
CheckpointID: "test",
}

{
// FIXME: ipv6 iptables modules are not uploaded in the test environment
cmd := exec.Command("bash", "-c", "set -x; "+
"mount --bind $(type -P true) $(type -P ip6tables-restore) && "+
"mount --bind $(type -P true) $(type -P ip6tables-save)")
stdoutStderr, err = cmd.CombinedOutput()
t.Logf("%s", stdoutStderr)
assert.NilError(t, err)

defer func() {
cmd := exec.Command("bash", "-c", "set -x; "+
"umount -c -i -l $(type -P ip6tables-restore); "+
"umount -c -i -l $(type -P ip6tables-save)")
stdoutStderr, err = cmd.CombinedOutput()
t.Logf("%s", stdoutStderr)
assert.NilError(t, err)
}()
}
t.Log("Do a checkpoint and leave the container running")
err = client.CheckpointCreate(ctx, cID, cptOpt)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions integration/internal/container/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/pkg/errors"
)

// ExecResult represents a result returned from Exec()
Expand Down Expand Up @@ -81,6 +82,9 @@ func Exec(ctx context.Context, cli client.APIClient, id string, cmd []string) (E
if err != nil {
return ExecResult{}, err
}
if iresp.Running == true {
return ExecResult{}, errors.New("exec still running!")
}

return ExecResult{ExitCode: iresp.ExitCode, outBuffer: &outBuf, errBuffer: &errBuf}, nil
}
2 changes: 2 additions & 0 deletions libcontainerd/remote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@ func (c *client) processEvent(ctr *container, et libcontainerdtypes.EventType, e
c.logger.WithError(err).WithFields(logrus.Fields{
"container": ei.ContainerID,
"process": ei.ProcessID,
"p.ID": p.ID(),
"p.PID": p.Pid(),
}).Warn("failed to delete process")
}
ctr.deleteProcess(ei.ProcessID)
Expand Down
2 changes: 1 addition & 1 deletion vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ github.com/googleapis/gax-go v2.0.0
google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9

# containerd
github.com/containerd/containerd a15b6e2097c48b632dbdc63254bad4c62b69e709
github.com/containerd/containerd 64438b72f2c0ff999f28bba9ca03d7ce6789a08c git://github.com/kolyshkin/containerd.git
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
github.com/containerd/continuity 004b46473808b3e7a4a3049c20e4376c91eb966d
github.com/containerd/cgroups dbea6f2bd41658b84b00417ceefa416b979cbf10
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/containerd/containerd/process.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.