From 4970e771aba15f0a3e68e90d11d308836b13a398 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 25 Jul 2020 12:59:53 -0700 Subject: [PATCH] wgengine: add debug knob to disable the watchdog during debugging It launches goroutines and interferes with panic-based debugging, obscuring stacks. --- wgengine/watchdog.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wgengine/watchdog.go b/wgengine/watchdog.go index 60826ac43..bc1444217 100644 --- a/wgengine/watchdog.go +++ b/wgengine/watchdog.go @@ -6,7 +6,9 @@ package wgengine import ( "log" + "os" "runtime/pprof" + "strconv" "strings" "time" @@ -24,6 +26,9 @@ import ( // // If they do not, the watchdog crashes the process. func NewWatchdog(e Engine) Engine { + if v, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_DISABLE_WATCHDOG")); v { + return e + } return &watchdogEngine{ wrap: e, logf: log.Printf,