Skip to content

Commit a70a04e

Browse files
authored
Merge pull request #1350 remove quotas from background goroutine label
2 parents 2303ce2 + 3b236cf commit a70a04e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Removed double quotas from goroutine labels background workers for prevent problem with pprof
2+
13
## v3.75.2
24
* Fixed build for go1.20
35

internal/background/worker.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"runtime/pprof"
8+
"strings"
89
"sync"
910

1011
"github.com/ydb-platform/ydb-go-sdk/v3/internal/empty"
@@ -144,7 +145,9 @@ func (b *Worker) starterLoop(ctx context.Context) {
144145
go func(task backgroundTask) {
145146
defer b.workers.Done()
146147

147-
pprof.Do(ctx, pprof.Labels("background", task.name), task.callback)
148+
safeLabel := strings.ReplaceAll(task.name, `"`, `'`)
149+
150+
pprof.Do(ctx, pprof.Labels("background", safeLabel), task.callback)
148151
}(bgTask)
149152
}
150153
}

0 commit comments

Comments
 (0)