Skip to content

Commit 76b583e

Browse files
committed
tt: add ignoring of the SIGURG signal sending by go runtime
This patch fixes the problem, which was occurring when the watchdog process received a signal SIGURG from go runtime[1][2] and passed it to the forked process before the exec call. Fixed by adding a call of the Ignore function. Receiving this signal is unexpected, cause tt doesn't work with sockets at all. [1] - https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md [2] - golang/go#37942 Closes #325
1 parent d2bf8b2 commit 76b583e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/running/watchdog.go

+7
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ func (wd *Watchdog) StartSignalHandling() {
131131
signal.Reset()
132132
signal.Notify(sigChan)
133133

134+
// This call is needed to ignore SIGURG signals which are part of
135+
// preemptive multitasking implementation in go. See:
136+
// https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md.
137+
// Also, there is no way to detect if a signal is related to the runtime or not:
138+
// https://github.com/golang/go/issues/37942.
139+
signal.Ignore(syscall.SIGURG)
140+
134141
// Set barrier to synchronize with the main loop when the Instance stops.
135142
wd.doneBarrier.Add(1)
136143

0 commit comments

Comments
 (0)