mobycli: ignore SIGURG on Linux and Darwin

Equivalent of fff164c22e
and cedaf44ea2

In go1.14+, SIGURG is used by the runtime to handle preemtable system calls.
In practice this signal is caught *frequently*.

For reference:

https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md
golang/go#37942

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-06-07 12:44:55 +02:00
parent 165686838e
commit b4c8a9dc5f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 59 additions and 2 deletions

View file

@ -106,8 +106,13 @@ func RunDocker(childExit chan bool, args ...string) error {
if cmd.Process == nil {
continue // can happen if receiving signal before the process is actually started
}
// nolint errcheck
cmd.Process.Signal(sig)
// In go1.14+, the go runtime issues SIGURG as an interrupt to
// support preemptable system calls on Linux. Since we can't
// forward that along we'll check that here.
if isRuntimeSig(sig) {
continue
}
_ = cmd.Process.Signal(sig)
case <-childExit:
return
}