]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Remove pprof labels for webseed request read routine
authorMatt Joiner <anacrolix@gmail.com>
Thu, 14 Aug 2025 02:40:18 +0000 (12:40 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 14 Aug 2025 02:40:18 +0000 (12:40 +1000)
webseed-peer.go

index 2ebfd66c7e81cf41cbf1a17c8f167cf92249f72b..cbeac41c3f76238adbe79e8c614f117f4d445ce8 100644 (file)
@@ -7,6 +7,7 @@ import (
        "io"
        "log/slog"
        "math/rand"
+       "runtime/pprof"
        "strings"
        "sync"
        "time"
@@ -167,7 +168,11 @@ func (ws *webseedPeer) spawnRequest(begin, end RequestIndex, logger *slog.Logger
                "end", end,
                "len", end-begin,
        )
-       go ws.runRequest(&wsReq)
+       go func() {
+               // Detach cost association from webseed update requests routine.
+               pprof.SetGoroutineLabels(context.Background())
+               ws.runRequest(&wsReq)
+       }()
 }
 
 func (me *webseedPeer) getRequestKey(wr *webseedRequest) webseedUniqueRequestKey {