Fix race condition in PerNodeCounter by tracking processed events#4363
Merged
markmandel merged 2 commits intoagones-dev:mainfrom Dec 1, 2025
Merged
Fix race condition in PerNodeCounter by tracking processed events#4363markmandel merged 2 commits intoagones-dev:mainfrom
markmandel merged 2 commits intoagones-dev:mainfrom
Conversation
Introduce a 'processed' struct to track GameServer state by UID, resource version, state, and node name. This prevents duplicate events from being counted multiple times, fixing a race condition that caused flaky tests. The processed map ensures that Add/Modify events for the same GameServer are only counted once if they represent the same state.
Collaborator
|
Build Succeeded 🥳 Build Id: ce678b60-3738-4d39-919b-b09910bb9042 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
Collaborator
|
Build Succeeded 🥳 Build Id: 6916c410-67d1-4214-8057-da4d8604ca94 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
mnthe
pushed a commit
to mnthe/agones
that referenced
this pull request
Mar 23, 2026
…ones-dev#4363) Introduce a 'processed' struct to track GameServer state by UID, resource version, state, and node name. This prevents duplicate events from being counted multiple times, fixing a race condition that caused flaky tests. The processed map ensures that Add/Modify events for the same GameServer are only counted once if they represent the same state.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this?
/kind bug
What this PR does / Why we need it:
Introduce a 'processed' struct to track GameServer state by UID, resource version, state, and node name. This prevents duplicate events from being counted multiple times, fixing a race condition that caused flaky tests.
The processed map ensures that Add/Modify events for the same GameServer are only counted once if they represent the same state.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
Flaky tests found a bug! That is what they do sometimes!
This is a bug that has been around for years but is probably small and rare enough that it didn't impact very much, but probably caused some people to scratch their heads occasionally on node packing. Now we'll get accurate node counts!