mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Exempt SIGPIPE from sentry signal forwarding.
The sentry may get SIGPIPE from writing to readerless pipes or shutdown sockets; in these cases, it's incorrect to forward the SIGPIPE to app PID 1. (It would be correct to send SIGPIPE to the app thread performing the write instead, but we can't do so with signal forwarding since (1) we can't identify the correct app thread to signal and (2) Go signal handling with os/signal is async - the sentry thread that received SIGPIPE continued execution after doing so, so the app thread may already be running. Having the sentry send SIGPIPE independently of the host is gvisor.dev/issue/161.) Updates #7293 PiperOrigin-RevId: 445469810
This commit is contained in:
@@ -90,6 +90,10 @@ func StartSignalForwarding(handler func(linux.Signal)) func() {
|
||||
if sig == int(linux.SIGURG) {
|
||||
continue
|
||||
}
|
||||
// SIGPIPE is received when sending to disconnected host pipes/sockets.
|
||||
if sig == int(linux.SIGPIPE) {
|
||||
continue
|
||||
}
|
||||
signal.Notify(sigchan, unix.Signal(sig))
|
||||
}
|
||||
// Start up our listener.
|
||||
|
||||
Reference in New Issue
Block a user