]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Clear pprof labels in spawned webseed requests
authorMatt Joiner <anacrolix@gmail.com>
Wed, 6 Aug 2025 10:34:56 +0000 (20:34 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 6 Aug 2025 10:34:56 +0000 (20:34 +1000)
webseed/client.go

index 10c8fcdf216594b89f56923ce99f745b2d49c6b2..ec2040d20a9a2029d9cc1ff261d237d6197f33e9 100644 (file)
@@ -9,6 +9,7 @@ import (
        "log/slog"
        "net/http"
        "os"
+       "runtime/pprof"
        "strings"
        "sync"
 
@@ -156,6 +157,7 @@ func (ws *Client) StartNewRequest(ctx context.Context, r RequestSpec, debugLogge
                bodyPipe: body,
        }
        go func() {
+               pprof.SetGoroutineLabels(context.Background())
                err := ws.readRequestPartResponses(ctx, w, requestParts)
                panicif.Err(w.CloseWithError(err))
        }()