Skip to content

Commit 97ec3cc

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 d6d2a71 commit 97ec3cc

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
@@ -137,6 +137,13 @@ func (wd *Watchdog) StartSignalHandling() {
137137
signal.Reset()
138138
signal.Notify(sigChan)
139139

140+
// This call is needed to ignore SIGURG signals which are part of
141+
// preemptive multitasking implementation in go. See:
142+
// https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md.
143+
// Also, there is no way to detect if a signal is related to the runtime or not:
144+
// https://github.com/golang/go/issues/37942.
145+
signal.Ignore(syscall.SIGURG)
146+
140147
// Set barrier to synchronize with the main loop when the Instance stops.
141148
wd.doneBarrier.Add(1)
142149

0 commit comments

Comments
 (0)