-
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
GraceTermination when GameServer get deleted #3141
Conversation
Build Failed 😱 Build Id: 1fa68d38-e847-40bf-bee1-fa9f19b9ac04 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 788d61e7-4308-4d5f-9d7d-b4fbfbe60c7a To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: e5618895-80e0-44f7-82a3-e2d4ea62af87 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
pkg/sdkserver/sdkserver.go
Outdated
|
||
// Explicitly update gsStateChannel if current state is Shutdown since sendGameServerUpdate will not triggered. | ||
if runtime.FeatureEnabled(runtime.FeatureSDKGracefulTermination) { | ||
if s.gsState == agonesv1.GameServerStateShutdown && gs.Status.State != agonesv1.GameServerStateShutdown { |
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.
LGTM, I think. Idiomatically this should all be the same if
, i.e.:
if runtime.FeatureEnabled(runtime.FeatureSDKGracefulTermination) && s.gsState == agonesv1.GameServerStateShutdown && gs.Status.State != agonesv1.GameServerStateShutdown
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.
Done
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.
Thanks for the contribution!
I'm glad someone solved this problem |
Build Failed 😱 Build Id: 03b9c684-c69c-41a9-b760-f6e9d08f6f09 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 37c4b061-2273-44c9-9771-9b41afa388b9 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 17986985-5d40-48e0-8d4b-e696327b6387 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: bc163ac8-2166-498d-9e9c-aa9837c14c4f 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 Succeeded 👏 Build Id: 6775f5bf-e772-4905-a648-feb9c91f226e 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 NOT APPROVED This pull-request has been approved by: qizichao-dm, zmerlynn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Current SDKGracefulTermination implementation uses gsStateChannel which get updated in sendGameServerUpdate. However, when GameServer gets deleted (e.g. when fleet updates), sendGameServerUpdate will not be triggered because updateState() will skip update in this case (gs.IsBeingDeleted() returns true). Therefore SDK server will blocks even SDK.Shutdown() has been called. This PR solves the issue by explicitly updating gsStateChannel when * GS is being deleted * Current SDK server state is Shutdown * State of GS is not Shutdown.
What type of PR is this?
/kind bug
What this PR does / Why we need it:
Current SDKGracefulTermination implementation uses gsStateChannel which get updated in sendGameServerUpdate. However, when GameServer gets deleted (e.g. when fleet updates), sendGameServerUpdate will not be triggered because updateState() will skip update in this case (gs.IsBeingDeleted() returns true). Therefore SDK server will blocks even SDK.Shutdown() has been called.
This PR solves the issue by explicitly updating gsStateChannel when
Which issue(s) this PR fixes:
Closes #
Special notes for your reviewer: