Skip to content

Commit 46174ed

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 8899dd6 commit 46174ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/running/watchdog.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ func (wd *Watchdog) startSignalHandling() {
113113
sigChan := make(chan os.Signal, 1)
114114
signal.Notify(sigChan)
115115

116+
// This call is needed to ignore SIGURG signals which are part of
117+
// preemptive multitasking implementation in go. See:
118+
// https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md.
119+
// Also, there is no way to detect if a signal is related to the runtime or not:
120+
// https://github.com/golang/go/issues/37942.
121+
signal.Ignore(syscall.SIGURG)
122+
116123
// Set barrier to synchronize with the main loop when the Instance stops.
117124
wd.doneBarrier.Add(1)
118125

0 commit comments

Comments
 (0)