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

Data race in leases_test.go #867

Closed
bobvawter opened this issue May 13, 2024 · 0 comments · Fixed by #868
Closed

Data race in leases_test.go #867

bobvawter opened this issue May 13, 2024 · 0 comments · Fixed by #868
Assignees

Comments

@bobvawter
Copy link
Member

https://github.com/cockroachdb/replicator/actions/runs/9070784347/job/24923391620#step:7:6779

==================
WARNING: DATA RACE
Write at 0x00c00043c120 by goroutine 109:
  github.com/cockroachdb/replicator/internal/staging/leases.TestLeases.func7.1()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases_test.go:252 +0x3a
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.22.2/x64/src/runtime/panic.go:602 +0x5d
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.2/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.2/x64/src/testing/testing.go:1742 +0x44

Previous read at 0x00c00043c120 by goroutine 6:
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).tryRelease()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:437 +0x197
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).release.func1()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:423 +0xe4
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).release.Retry.func2()
      /home/runner/work/replicator/replicator/internal/util/retry/retry.go:69 +0x4f
  github.com/cockroachdb/replicator/internal/util/retry.Loop()
      /home/runner/work/replicator/replicator/internal/util/retry/retry.go:98 +0x213
  github.com/cockroachdb/replicator/internal/util/retry.Retry()
      /home/runner/work/replicator/replicator/internal/util/retry/retry.go:68 +0x21a
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).release()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:421 +0x95
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).Acquire.func2()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:179 +0xe4
  github.com/cockroachdb/replicator/internal/staging/leases.(*leaseFacade).Release()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:113 +0xa1
  github.com/cockroachdb/replicator/internal/staging/leases.(*leases).Acquire.func3()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases.go:185 +0x12

Goroutine 109 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.22.2/x64/src/testing/testing.go:1742 +0x825
  github.com/cockroachdb/replicator/internal/staging/leases.TestLeases()
      /home/runner/work/replicator/replicator/internal/staging/leases/leases_test.go:243 +0xbe9
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.2/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.2/x64/src/testing/testing.go:1742 +0x44

Goroutine 6 (running) created at:
  runtime.createfing()
      /opt/hostedtoolcache/go/1.22.2/x64/src/runtime/mfinal.go:164 +0x3c
  os.NewFile()
      /opt/hostedtoolcache/go/1.22.2/x64/src/os/file_unix.go:119 +0x87
  os.init()
      /opt/hostedtoolcache/go/1.22.2/x64/src/os/file.go:65 +0x332
==================
@bobvawter bobvawter self-assigned this May 13, 2024
bobvawter added a commit that referenced this issue May 14, 2024
The tests in this package need to adjust timeouts and polling intervals. The
existing tests are subject to a race condition during cleanup. This change
creates a shallow copy before adjusting the configuration, so no deferred
restoration is necessary.

Fixes #867
github-merge-queue bot pushed a commit that referenced this issue May 14, 2024
The tests in this package need to adjust timeouts and polling intervals. The
existing tests are subject to a race condition during cleanup. This change
creates a shallow copy before adjusting the configuration, so no deferred
restoration is necessary.

Fixes #867
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

Successfully merging a pull request may close this issue.

1 participant