Skip to content

Commit 04eaab3

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 f0863fa commit 04eaab3

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
@@ -150,6 +150,13 @@ func (wd *Watchdog) startSignalHandling() {
150150
signal.Reset()
151151
signal.Notify(sigChan)
152152

153+
// This call is needed to ignore SIGURG signals which are part of
154+
// preemptive multitasking implementation in go. See:
155+
// https://go.googlesource.com/proposal/+/master/design/24543-non-cooperative-preemption.md.
156+
// Also, there is no way to detect if a signal is related to the runtime or not:
157+
// https://github.com/golang/go/issues/37942.
158+
signal.Ignore(syscall.SIGURG)
159+
153160
// Set barrier to synchronize with the main loop when the Instance stops.
154161
wd.doneBarrier.Add(1)
155162

0 commit comments

Comments
 (0)