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

fix: enabled data race #3041

Merged
merged 1 commit into from
Mar 1, 2023
Merged

fix: enabled data race #3041

merged 1 commit into from
Mar 1, 2023

Conversation

fracasula
Copy link
Collaborator

@fracasula fracasula commented Feb 27, 2023

Description

Don't mind the stack trace that says v1.5.0, this happens on the latest of RudderServer as well.

Quick fix for:

==================
WARNING: DATA RACE
Write at 0x00c000195be0 by goroutine 905:
  github.com/rudderlabs/rudder-server/services/stats.(*statsdStats).Start()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/stats.go:126 +0x3de
  github.com/rudderlabs/device-mode-transformation-server/cmd/server.Run()
      /Users/debanjanchatterjee/backend/device-mode-transformation-server/cmd/server/main.go:51 +0x2c3
  github.com/rudderlabs/device-mode-transformation-server/cmd/server_test.beforeEach.func1()
      /Users/debanjanchatterjee/backend/device-mode-transformation-server/cmd/server/main_test.go:51 +0x3c
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/debanjanchatterjee/.go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x82

Previous read at 0x00c000195be0 by goroutine 463:
  github.com/rudderlabs/rudder-server/services/stats.(*statsdStats).collectPeriodicStats.func1()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/stats.go:177 +0xa4
  github.com/rudderlabs/rudder-server/services/stats.runtimeStatsCollector.outputGCStats()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/periodic.go:155 +0x255
  github.com/rudderlabs/rudder-server/services/stats.runtimeStatsCollector.zeroStats()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/periodic.go:92 +0x1b2
  github.com/rudderlabs/rudder-server/services/stats.runtimeStatsCollector.run.func1()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/periodic.go:59 +0x65
  runtime.deferreturn()
      /usr/local/go/src/runtime/panic.go:476 +0x32
  github.com/rudderlabs/rudder-server/services/stats.(*statsdStats).collectPeriodicStats.func2()
      /Users/debanjanchatterjee/.go/pkg/mod/github.com/rudderlabs/rudder-server@v1.5.0-preview.2/services/stats/stats.go:191 +0x117

Notion Ticket

< Notion Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@fracasula fracasula marked this pull request as ready for review February 27, 2023 15:14
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Base: 52.77% // Head: 52.64% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (db8c621) compared to base (4832630).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3041      +/-   ##
==========================================
- Coverage   52.77%   52.64%   -0.14%     
==========================================
  Files         334      334              
  Lines       52216    52216              
==========================================
- Hits        27558    27487      -71     
- Misses      23056    23127      +71     
  Partials     1602     1602              
Impacted Files Coverage Δ
services/stats/config.go 64.28% <ø> (ø)
services/stats/measurement.go 80.68% <100.00%> (ø)
services/stats/stats.go 98.22% <100.00%> (ø)
processor/stash/stash.go 45.25% <0.00%> (-21.54%) ⬇️
testhelper/freeport.go 66.66% <0.00%> (-13.34%) ⬇️
testhelper/log/log.go 7.69% <0.00%> (-3.85%) ⬇️
jobsdb/migration.go 76.28% <0.00%> (-2.07%) ⬇️
services/stats/periodic.go 89.43% <0.00%> (-1.63%) ⬇️
services/rsources/handler.go 73.82% <0.00%> (-0.83%) ⬇️
jobsdb/backup.go 75.40% <0.00%> (-0.36%) ⬇️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Successfully merging this pull request may close these issues.

None yet

3 participants