-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Prevent races counting missed heartbeats #49882
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Increments the `heartbeatsMissedByAuth` gauge directly instead of keeping a local count and setting the gauge once. This fixes a race caught in https://github.com/gravitational/teleport/actions/runs/11828850190/job/32959672995?pr=48949. ``` ================== WARNING: DATA RACE Write at 0x00c003857da8 by goroutine 48258: github.com/gravitational/teleport/lib/auth.(*Server).runPeriodicOperations.func3.1() /__w/teleport/teleport/lib/auth/auth.go:1471 +0x84 github.com/gravitational/teleport/lib/services.(*UnifiedResourceCache).getRange.func1.1() /__w/teleport/teleport/lib/services/unified_resource.go:239 +0x14d github.com/google/btree.(*node[go.shape.*uint8]).iterate() /go/pkg/mod/github.com/google/btree@v1.1.3/btree_generic.go:522 +0x62c github.com/google/btree.(*BTreeG[go.shape.*uint8]).AscendRange() /go/pkg/mod/github.com/google/btree@v1.1.3/btree_generic.go:752 +0x104 github.com/google/btree.(*BTreeG[*github.com/gravitational/teleport/lib/services.item]).AscendRange-fm() <autogenerated>:1 +0x58 github.com/gravitational/teleport/lib/services.(*UnifiedResourceCache).getRange.func1() /__w/teleport/teleport/lib/services/unified_resource.go:230 +0x7a8 github.com/gravitational/teleport/lib/services.(*UnifiedResourceCache).read() /__w/teleport/teleport/lib/services/unified_resource.go:591 +0x2ad github.com/gravitational/teleport/lib/services.(*UnifiedResourceCache).getRange() /__w/teleport/teleport/lib/services/unified_resource.go:215 +0x2d9 github.com/gravitational/teleport/lib/services.(*UnifiedResourceCache).IterateUnifiedResources() /__w/teleport/teleport/lib/services/unified_resource.go:288 +0xe6 github.com/gravitational/teleport/lib/auth.(*Server).runPeriodicOperations.func3() /__w/teleport/teleport/lib/auth/auth.go:1464 +0x237 Previous read at 0x00c003857da8 by goroutine 48219: github.com/gravitational/teleport/lib/auth.(*Server).runPeriodicOperations.func3() /__w/teleport/teleport/lib/auth/auth.go:1489 +0x2d2 Goroutine 48258 (running) created at: github.com/gravitational/teleport/lib/auth.(*Server).runPeriodicOperations() /__w/teleport/teleport/lib/auth/auth.go:1460 +0xf9e github.com/gravitational/teleport/lib/auth.initCluster.gowrap1() /__w/teleport/teleport/lib/auth/init.go:594 +0x33 Goroutine 48219 (finished) created at: github.com/gravitational/teleport/lib/auth.(*Server).runPeriodicOperations() /__w/teleport/teleport/lib/auth/auth.go:1460 +0xf9e github.com/gravitational/teleport/lib/auth.initCluster.gowrap1() /__w/teleport/teleport/lib/auth/init.go:594 +0x33 ================== ```
zmb3
approved these changes
Dec 6, 2024
rosstimothy
added
the
no-changelog
Indicates that a PR does not require a changelog entry
label
Dec 6, 2024
GavinFrazar
approved these changes
Dec 6, 2024
public-teleport-github-review-bot
bot
removed the request for review
from Tener
December 6, 2024 19:16
@rosstimothy See the table below for backport results.
|
This was referenced Dec 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport/branch/v14
backport/branch/v15
backport/branch/v16
backport/branch/v17
no-changelog
Indicates that a PR does not require a changelog entry
size/sm
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Increments the
heartbeatsMissedByAuth
gauge directly instead of keeping a local count and setting the gauge once. This fixes a race caught in https://github.com/gravitational/teleport/actions/runs/11828850190/job/32959672995?pr=48949.