Merge pull request #42415 from thaJeztah/more_ignore

pkg/signal: ignore SIGURG on all platforms
This commit is contained in:
Akihiro Suda 2021-05-26 16:18:21 +09:00 committed by GitHub
commit c6134474c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 29 deletions

View file

@ -12,13 +12,13 @@ import (
)
// CatchAll catches all signals and relays them to the specified channel.
// On Linux, SIGURG is not handled, as it's used by the Go runtime to support
// SIGURG is not handled, as it's used by the Go runtime to support
// preemptable system calls.
func CatchAll(sigc chan os.Signal) {
var handledSigs []os.Signal
for _, s := range SignalMap {
if isRuntimeSig(s) {
// Do not handle SIGURG on Linux, as in go1.14+, the go runtime issues
for n, s := range SignalMap {
if n == "URG" {
// Do not handle SIGURG, as in go1.14+, the go runtime issues
// SIGURG as an interrupt to support preemptable system calls on Linux.
continue
}

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal"
import (
"os"
"syscall"
)
@ -40,7 +39,3 @@ var SignalMap = map[string]syscall.Signal{
"XCPU": syscall.SIGXCPU,
"XFSZ": syscall.SIGXFSZ,
}
func isRuntimeSig(_ os.Signal) bool {
return false
}

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal"
import (
"os"
"syscall"
)
@ -42,7 +41,3 @@ var SignalMap = map[string]syscall.Signal{
"XCPU": syscall.SIGXCPU,
"XFSZ": syscall.SIGXFSZ,
}
func isRuntimeSig(_ os.Signal) bool {
return false
}

View file

@ -3,7 +3,6 @@
package signal // import "github.com/docker/docker/pkg/signal"
import (
"os"
"syscall"
"golang.org/x/sys/unix"
@ -82,7 +81,3 @@ var SignalMap = map[string]syscall.Signal{
"RTMAX-1": sigrtmax - 1,
"RTMAX": sigrtmax,
}
func isRuntimeSig(s os.Signal) bool {
return s == unix.SIGURG
}

View file

@ -4,7 +4,6 @@
package signal // import "github.com/docker/docker/pkg/signal"
import (
"os"
"syscall"
"golang.org/x/sys/unix"
@ -83,7 +82,3 @@ var SignalMap = map[string]syscall.Signal{
"RTMAX-1": sigrtmax - 1,
"RTMAX": sigrtmax,
}
func isRuntimeSig(s os.Signal) bool {
return s == unix.SIGURG
}

View file

@ -1,7 +1,6 @@
package signal // import "github.com/docker/docker/pkg/signal"
import (
"os"
"syscall"
)
@ -25,7 +24,3 @@ var SignalMap = map[string]syscall.Signal{
"KILL": syscall.SIGKILL,
"TERM": syscall.SIGTERM,
}
func isRuntimeSig(_ os.Signal) bool {
return false
}