wgengine: flesh out some docs

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-11 15:21:24 -08:00
committed by Brad Fitzpatrick
parent 490e586eac
commit 819daf10e2
6 changed files with 68 additions and 24 deletions

View File

@@ -5,9 +5,9 @@
package wgengine
import (
"bytes"
"log"
"runtime/pprof"
"strings"
"time"
"github.com/tailscale/wireguard-go/wgcfg"
@@ -45,7 +45,7 @@ func (e *watchdogEngine) watchdogErr(name string, fn func() error) error {
t.Stop()
return err
case <-t.C:
buf := new(bytes.Buffer)
buf := new(strings.Builder)
pprof.Lookup("goroutine").WriteTo(buf, 1)
e.logf("wgengine watchdog stacks:\n%s", buf.String())
e.fatalf("wgengine: watchdog timeout on %s", name)