-
Notifications
You must be signed in to change notification settings - Fork 810
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
Do not refresh cache if no update #3343
Conversation
@@ -70,6 +70,9 @@ func NewAllocationCache(informer informerv1.GameServerInformer, counter *gameser | |||
if !ok { | |||
return | |||
} | |||
if oldGs.ObjectMeta.ResourceVersion == newGs.ObjectMeta.ResourceVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Good find!
Worth a unit test, or nah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I will add an unit test.
Build Failed 😱 Build Id: 97bb2b2c-958f-4cbe-94d7-5f69b470d551 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 4c1dea12-c298-4426-8d75-2c314ea4ced0 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:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gongmax, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: 8c0de90a-dae6-4aa0-93e4-a38a93f554cd 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:
|
What type of PR is this?
/kind bug
What this PR does / Why we need it:
In the UpdateFunc, check whether there are actual change for the GameServer by checking the resourceVersion, and skip the allocation cache refresh for the GameServer if so. This prevents the race condition where a GS is Allocated and removed from the cache but the UpdateFunc adds it back with a stale state.
Which issue(s) this PR fixes:
Closes #
Special notes for your reviewer: