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

Datarace spotted on scope_registry.go and scope.go #259

Open
marcaudefroy opened this issue Apr 24, 2024 · 1 comment
Open

Datarace spotted on scope_registry.go and scope.go #259

marcaudefroy opened this issue Apr 24, 2024 · 1 comment

Comments

@marcaudefroy
Copy link

Hello!

Thanks you very much for this lib. Very appreciate your work.

I use this lib on my project and when I ran it with -trace option, a datarace has been detected.
Here the stack trace, I hope this will helps.

Have a good day!

WARNING: DATA RACE
Read at 0x00c00002c708 by goroutine 22:
  github.com/uber-go/tally/v4.(*scopeRegistry).reportInternalMetrics.func1()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope_registry.go:314 +0x144
  github.com/uber-go/tally/v4.(*scopeRegistry).ForEachScope()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope_registry.go:159 +0x18b
  github.com/uber-go/tally/v4.(*scopeRegistry).reportInternalMetrics()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope_registry.go:310 +0x309
  github.com/uber-go/tally/v4.(*scopeRegistry).CachedReport()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope_registry.go:137 +0x9c
  github.com/uber-go/tally/v4.(*scope).reportRegistry()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:278 +0xdc
  github.com/uber-go/tally/v4.(*scope).reportLoopRun()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:270 +0x4e
  github.com/uber-go/tally/v4.(*scope).reportLoop()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:258 +0xce
  github.com/uber-go/tally/v4.newRootScope.func1()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:198 +0x97

Previous write at 0x00c00002c708 by goroutine 16:
  github.com/uber-go/tally/v4.(*scope).Gauge()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:341 +0x4e5
  go.temporal.io/sdk/contrib/tally.(*prometheusNamingScope).Gauge()
      /go/pkg/mod/go.temporal.io/sdk/contrib/[email protected]/prometheus.go:55 +0x51
  go.temporal.io/sdk/contrib/tally.metricsHandler.Gauge()
      /go/pkg/mod/go.temporal.io/sdk/contrib/[email protected]/handler.go:88 +0x6c
  go.temporal.io/sdk/contrib/tally.(*metricsHandler).Gauge()
      <autogenerated>:1 +0x1f
  go.temporal.io/sdk/internal.newNumPollerMetric()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_task_pollers.go:175 +0xc6
  go.temporal.io/sdk/internal.newWorkflowTaskPoller()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_task_pollers.go:298 +0x164
  go.temporal.io/sdk/internal.newWorkflowTaskWorkerInternal()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_worker.go:311 +0xd2
  go.temporal.io/sdk/internal.newWorkflowWorkerInternal()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_worker.go:299 +0x224
  go.temporal.io/sdk/internal.newWorkflowWorker()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_worker.go:237 +0x1745
  go.temporal.io/sdk/internal.NewAggregatedWorker()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/internal_worker.go:1629 +0x150a
  go.temporal.io/sdk/internal.NewWorker()
      /go/pkg/mod/go.temporal.io/[email protected]/internal/worker.go:292 +0x98
  go.temporal.io/sdk/worker.New()
      /go/pkg/mod/go.temporal.io/[email protected]/worker/worker.go:245 +0x57c
  stash.ovh.net/domains/temporal-robots/workers.NewRegistries()
      /tmp/103126bf707e50fff449876c796c4e15/run/workers/workers.go:74 +0x4da
  stash.ovh.net/domains/temporal-robots.startWorkers()
      /tmp/103126bf707e50fff449876c796c4e15/run/main.go:102 +0x52e
  stash.ovh.net/domains/temporal-robots.main()
      /tmp/103126bf707e50fff449876c796c4e15/run/main.go:79 +0xbe4
  stash.ovh.net/domains/temporal-robots.TestIntegration()
      /tmp/103126bf707e50fff449876c796c4e15/run/main_test.go:9 +0x1c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x44

Goroutine 22 (running) created at:
  github.com/uber-go/tally/v4.newRootScope()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:196 +0xdbd
  github.com/uber-go/tally/v4.NewRootScope()
      /go/pkg/mod/github.com/uber-go/tally/[email protected]/scope.go:118 +0x4a4
  stash.ovh.net/domains/temporal-robots/workers.newPrometheusScope()
      /tmp/103126bf707e50fff449876c796c4e15/run/workers/client.go:85 +0x478
  stash.ovh.net/domains/temporal-robots/workers.NewTemporalClient()
      /tmp/103126bf707e50fff449876c796c4e15/run/workers/client.go:48 +0x9c4
  stash.ovh.net/domains/temporal-robots.main()
      /tmp/103126bf707e50fff449876c796c4e15/run/main.go:64 +0x777
  stash.ovh.net/domains/temporal-robots.TestIntegration()
      /tmp/103126bf707e50fff449876c796c4e15/run/main_test.go:9 +0x1c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1742 +0x44

Goroutine 16 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1742 +0x825
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:2161 +0x85
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1689 +0x21e
  testing.runTests()
      /usr/local/go/src/testing/testing.go:2159 +0x8be
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:2027 +0xf17
  main.main()
      _testmain.go:81 +0x2e4
@kevindweb
Copy link

This is solved by #257 , @vdarulis do you know when the next release will happen to avoid bumping to an unreleased commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants