summaryrefslogtreecommitdiff
path: root/pkg/rootless
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-08-17 12:10:20 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-08-17 12:10:20 +0200
commitfe2be7f886ac3be68a1899eeb63f756d6fe3d744 (patch)
tree6b43476231046f0f57a63ed2822f0bbe9a499f74 /pkg/rootless
parent8c228bdbd031e5930e6319e8fe25b3ff340919f3 (diff)
downloadpodman-fe2be7f886ac3be68a1899eeb63f756d6fe3d744.tar.gz
podman-fe2be7f886ac3be68a1899eeb63f756d6fe3d744.tar.bz2
podman-fe2be7f886ac3be68a1899eeb63f756d6fe3d744.zip
make sure that signal buffers are sufficiently big
Dealing with os.Signal channels seems more like an art than science since signals may get lost. os.Notify doesn't block on an unbuffered channel, so users are expected to know what they're doing or hope for the best. In the recent past, I've seen a number of flakes and BZs on non-amd64 architectures where I was under the impression that signals may got lost, for instance, during stop and exec. [NO TESTS NEEDED] since this is art. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/rootless')
-rw-r--r--pkg/rootless/rootless_linux.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index 9ef56acb4..c046ecde7 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -397,8 +397,6 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
return false, -1, errors.Wrapf(err, "error setting up the process")
}
- c := make(chan os.Signal, 1)
-
signals := []os.Signal{}
for sig := 0; sig < numSig; sig++ {
if sig == int(unix.SIGTSTP) {
@@ -407,6 +405,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
signals = append(signals, unix.Signal(sig))
}
+ c := make(chan os.Signal, len(signals))
gosignal.Notify(c, signals...)
defer gosignal.Reset()
go func() {