Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: data race when using metrics #1431

Open
MaxShoshin opened this issue Aug 28, 2024 · 0 comments
Open

bug: data race when using metrics #1431

MaxShoshin opened this issue Aug 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MaxShoshin
Copy link
Contributor

Bug Report

YDB GO SDK version:

github.com/ydb-platform/ydb-go-sdk/v3 v3.77.0

Environment

macos, tests with datarace detector

Current behavior:

Got DataRace report:

WARNING: DATA RACE
Read at 0x00c0015a7ce0 by goroutine 8132:
runtime.mapiterinit()
/usr/local/go/src/runtime/map.go:816 +0x0
github.com/ydb-platform/ydb-go-sdk/v3/metrics.driver.func5.1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/metrics/driver.go:108 +0x354
github.com/ydb-platform/ydb-go-sdk/v3/trace.(*Driver).Compose.func24.2()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/trace/driver_gtrace.go:855 +0x155
github.com/ydb-platform/ydb-go-sdk/v3/trace.DriverOnBalancerUpdate.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/trace/driver_gtrace.go:1579 +0x174
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).applyDiscoveredEndpoints.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:140 +0x515
runtime.deferreturn()
/usr/local/go/src/runtime/panic.go:602 +0x5d
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).clusterDiscoveryAttempt()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:121 +0x6e6
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).clusterDiscovery.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:61 +0x71
github.com/ydb-platform/ydb-go-sdk/v3/retry.Retry.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/retry/retry.go:262 +0x42
github.com/ydb-platform/ydb-go-sdk/v3/retry.opWithRecovergo.shape.*uint8
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/retry/retry.go:409 +0x14a
github.com/ydb-platform/ydb-go-sdk/v3/retry.RetryWithResultgo.shape.*uint8
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/retry/retry.go:341 +0x9b6
github.com/ydb-platform/ydb-go-sdk/v3/retry.Retry()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/retry/retry.go:261 +0xa7
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).clusterDiscovery()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:58 +0x28c
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.New()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:236 +0xe45
github.com/ydb-platform/ydb-go-sdk/v3.(*Driver).connect()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/driver.go:417 +0x770
github.com/ydb-platform/ydb-go-sdk/v3.Open()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/driver.go:276 +0x984
...skipped....
Previous write at 0x00c0015a7ce0 by goroutine 113:
runtime.mapassign_faststr()
/usr/local/go/src/runtime/map_faststr.go:203 +0x0
github.com/ydb-platform/ydb-go-sdk/v3/metrics.driver.func5.1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/metrics/driver.go:117 +0x687
github.com/ydb-platform/ydb-go-sdk/v3/trace.(*Driver).Compose.func24.2()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/trace/driver_gtrace.go:855 +0x155
github.com/ydb-platform/ydb-go-sdk/v3/trace.DriverOnBalancerUpdate.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/trace/driver_gtrace.go:1579 +0x174
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).applyDiscoveredEndpoints.func1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:140 +0x515
runtime.deferreturn()
/usr/local/go/src/runtime/panic.go:602 +0x5d
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).clusterDiscoveryAttempt()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:121 +0x6e6
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).clusterDiscoveryAttempt-fm()
:1 +0x47
github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater.(*repeater).wakeUp()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater/repeater.go:166 +0x398
github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater.(*repeater).worker.func2()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater/repeater.go:206 +0x653
github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater.(*repeater).worker()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater/repeater.go:219 +0x62a
github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater.New.gowrap1()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater/repeater.go:117 +0x6b

Goroutine 113 (running) created at:
github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater.New()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater/repeater.go:117 +0x606
github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.New()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/balancer.go:241 +0x10da
github.com/ydb-platform/ydb-go-sdk/v3.(*Driver).connect()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/driver.go:417 +0x770
github.com/ydb-platform/ydb-go-sdk/v3.Open()
/gopath/src/ttt/vendor/github.com/ydb-platform/ydb-go-sdk/v3/driver.go:276 +0x984

@MaxShoshin MaxShoshin added the bug Something isn't working label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant