Skip to content

Commit 639231c

Browse files
authored
Merge branch 'master' into buffer
2 parents d40fb43 + a70a04e commit 639231c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* Fixed `internal/xstrings.Buffer()` leak without call `buffer.Free()`
2+
* Removed double quotas from goroutine labels background workers for prevent problem with pprof
23

34
## v3.75.2
45
* Fixed build for go1.20

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)