-
Notifications
You must be signed in to change notification settings - Fork 813
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
Check for DeletionTimestamp of fleet and gameserverset before scaling #2526
Conversation
Build Succeeded 👏 Build Id: b1f530c3-2be9-49df-9d7d-413a0e40f7ba 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:
|
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.
This straight makes sense! Thanks so much for the fix!
The only thing that would block this from merge is to add some unit tests to make sure we never mess up this functionality in the future.
(Do we need e2e tests? 🤔 )
Build Succeeded 👏 Build Id: 8d874f50-be96-41a5-85c0-e5fabca05ed3 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:
|
Hey, @markmandel thanks for taking the time to review. I just added some unit tests to cover this. I'm not sure if the e2e is necessary as it is a very small change, but I'll let you decide on that :) |
This looks good! @roberthbailey how do we feel about including this while we're in feature freeze? It is a bug fix, and seems to be low risk 🤔 WDYT? Or play it safe and bring it into the next release? |
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.
Should there also be a change in pkg/fleets/controller.go? If you delete a fleet with foreground cascading deletion and then proceed to update the fleet (e.g. change the container image) before the cascading deletion completes will the fleet controller create a new game server set which will then get orphaned?
@@ -307,6 +307,12 @@ func (c *Controller) syncGameServerSet(ctx context.Context, key string) error { | |||
|
|||
numServersToAdd, toDelete, isPartial := computeReconciliationAction(gsSet.Spec.Scheduling, list, c.counter.Counts(), | |||
int(gsSet.Spec.Replicas), maxGameServerCreationsPerBatch, maxGameServerDeletionsPerBatch, maxPodPendingCount) | |||
|
|||
// GameserverSet is marked for deletion then don't add gameservers. | |||
if !gsSet.DeletionTimestamp.IsZero() { |
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.
Similar question here - should we check for the finalizer being set?
Oooh! That is an excellent question. I would argue yes - even if just to ensure no extra resource creation in general when a Fleet is being deleted (either foreground or background). |
I agree with this. I've just committed a change that considers this as well. |
Build Failed 😱 Build Id: 55dec21f-58a6-4b12-ae6f-87f8d9be69fc To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
@markmandel the e2e tests on Cloud Build seemed to have failed I see a lot of |
Build Failed 😱 Build Id: 7b89e579-1841-4ec4-964f-03ca01514c44 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Looks like the deity of flakiness has decided to target this PR. Rerunning. |
Build Succeeded 👏 Build Id: 273c82cc-396b-4f86-89bf-2295d4238ce5 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:
|
Build Failed 😱 Build Id: b11be78b-571b-4270-b292-89355272654b To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
I merged main to my fork, build is failing again. Going to need you to retry it when you can @markmandel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: estebangarcia, 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 |
We are past feature freeze - and I fixed the 404 in our site testing, so this is good to merge 👍🏻 |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: d126582e-f88c-4fac-9b91-f15b2653b946 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:
|
…googleforgames#2526) Co-authored-by: Mark Mandel <markmandel@google.com>
What type of PR is this?
/kind bug
What this PR does / Why we need it:
It checks the DeletionTimestamp of GameServerSet and sets numServersToAdd to 0 and checks DeletionTimestamp of fleets managed by autoscaler and doesn't scale if they are marked for deletion.
This prevents agones from recreating gameservers from fleets marked for deletion by foreground cascading. As reported in #2524
Which issue(s) this PR fixes:
Closes #2524
Special notes for your reviewer:
Tested on AWS EKS 1.21.5