mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: don't redirect SIGURG which is used by Go's runtime scheduler
Go 1.14+ sends SIGURG to Ms to attempt asynchronous preemption of a G. Since it can't guarantee that a SIGURG is only related to preemption, it continues to forward them to signal.Notify (see runtime.sighandler). When runsc is running a container, there are three processes: a parent process and two children (sandbox and gopher). A parent process sets a signal handler for all signals and redirect them to the container init process. This logic should ignore SIGURG signals. We already ignore them in the Sentry, but it will be better to not notify about them when this is possible. PiperOrigin-RevId: 300345286
This commit is contained in:
@@ -83,6 +83,10 @@ func StartSignalForwarding(handler func(linux.Signal)) func() {
|
||||
// for their handling.
|
||||
var sigchans []chan os.Signal
|
||||
for sig := 1; sig <= numSignals+1; sig++ {
|
||||
// SIGURG is used by Go's runtime scheduler.
|
||||
if sig == int(linux.SIGURG) {
|
||||
continue
|
||||
}
|
||||
sigchan := make(chan os.Signal, 1)
|
||||
sigchans = append(sigchans, sigchan)
|
||||
signal.Notify(sigchan, syscall.Signal(sig))
|
||||
|
||||
Reference in New Issue
Block a user