| From bbf6b7774f247394e276f59a1f3c5772ded7846d Mon Sep 17 00:00:00 2001 |
| From: Robert Kolchmeyer <rkolchmeyer@google.com> |
| Date: Thu, 27 Jan 2022 17:45:10 -0800 |
| Subject: [PATCH 3/3] Revert "libcontainer/ignoreTerminateErrors: simplify for |
| Go 1.16+" |
| |
| This reverts commit 6a4f4a6a370383365f2ae9d515e94a784be85bb8. |
| --- |
| libcontainer/container_linux.go | 10 ++++++---- |
| 1 file changed, 6 insertions(+), 4 deletions(-) |
| |
| diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go |
| index e1d88258..58283ed9 100644 |
| --- a/libcontainer/container_linux.go |
| +++ b/libcontainer/container_linux.go |
| @@ -2246,11 +2246,13 @@ func ignoreTerminateErrors(err error) error { |
| if errors.As(err, &exitErr) { |
| return nil |
| } |
| - if errors.Is(err, os.ErrProcessDone) { |
| - return nil |
| - } |
| + // TODO: use errors.Is(err, os.ErrProcessDone) here and |
| + // remove "process already finished" string comparison below |
| + // once go 1.16 is minimally supported version. |
| + |
| s := err.Error() |
| - if strings.Contains(s, "Wait was already called") { |
| + if strings.Contains(s, "process already finished") || |
| + strings.Contains(s, "Wait was already called") { |
| return nil |
| } |
| return err |
| -- |
| 2.35.0.rc2.247.g8bbb082509-goog |
| |