Skip to content

Commit

Permalink
Merge pull request #1350 remove quotas from background goroutine label
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby authored Jul 18, 2024
2 parents 2303ce2 + 3b236cf commit a70a04e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Removed double quotas from goroutine labels background workers for prevent problem with pprof

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

Expand Down
5 changes: 4 additions & 1 deletion internal/background/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"runtime/pprof"
"strings"
"sync"

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

pprof.Do(ctx, pprof.Labels("background", task.name), task.callback)
safeLabel := strings.ReplaceAll(task.name, `"`, `'`)

pprof.Do(ctx, pprof.Labels("background", safeLabel), task.callback)
}(bgTask)
}
}
Expand Down

0 comments on commit a70a04e

Please sign in to comment.