From a4d9437a6417e2b01acba079139ddb2b58436fe8 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Fri, 14 Aug 2020 10:37:14 -0700 Subject: [PATCH] Best practices for game server shutdown Based on conversations in Slack, it was not clear on best practices on how to handle graceful shutdown in the game server process. Wrote some docs that both point to the Kubernetes documentation, but also provides a rule of thumb that should apply for most all cases. --- site/content/en/docs/Guides/Client SDKs/_index.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/site/content/en/docs/Guides/Client SDKs/_index.md b/site/content/en/docs/Guides/Client SDKs/_index.md index e396c46347..856011931d 100644 --- a/site/content/en/docs/Guides/Client SDKs/_index.md +++ b/site/content/en/docs/Guides/Client SDKs/_index.md @@ -121,9 +121,17 @@ relinquish control to an external service which likely doesn't have as much info {{< /alert >}} #### Shutdown() -This tells Agones to shut down the currently running game server. -The GameServer state will be set `Shutdown` and the -backing Pod will be deleted, if they have not shut themselves down already. +This tells Agones to shut down the currently running game server. The GameServer state will be set `Shutdown` and the +backing Pod will be Terminated. + +It's worth reading the [Termination of Pods](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination) +Kubernetes documentation, to understand the termination process, and the related configuration options. + +As a rule of thumb, implement a graceful shutdown in your game sever process when it receives the TERM signal +from Kubernetes when the backing Pod goes into Termination state. + +Be aware that if you use a variation of `System.exit(0)` after calling SDK.Shutdown(), your game server container may +restart for a brief period, inline with our [Health Checking]({{% ref "/docs/Guides/health-checking.md#health-failure-strategy" %}}) policies. ### Configuration Retrieval