googleforgames / agones

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes
https://agones.dev
Apache License 2.0
6k stars 791 forks source link

Possibility to toggle SDKGracefulTermination #3405

Open clrxbl opened 11 months ago

clrxbl commented 11 months ago

Is your feature request related to a problem? Please describe. I set my gameserver terminationGracePeriodSeconds value to something quite high so my gameserver has time to finish any games and other custom logic. With SDKGracefulTermination not existing in older Agones version, this isn't an issue, but after 1.33.0, this causes a behaviour issue where the gameserver container could cease existing while the Agones SDK sidecar will continue to always run until the terminationGracePeriod ends.

Describe the solution you'd like I would like the ability to be able to turn SDKGracefulTermination off.

Describe alternatives you've considered N/A

Additional context N/A

markmandel commented 11 months ago

Any reason your game server binary can't call SDK.Shutdown() at termination time, so everything will terminate appropriately?

clrxbl commented 11 months ago

Any reason your game server binary can't call SDK.Shutdown() at termination time, so everything will terminate appropriately?

You're quick to respond! I was mid-edit on the initial issue. This is something that I could do but I realize that this is not always an option in the event that the gameserver crashes/deadlocks before it hits this logic.

markmandel commented 11 months ago

If it crashes / goes Unhealthy, then it ends up in Shutdown state (after a transition through Unhealthy) - so it should end up not hanging.

So my recommendation - handle termination correctly with SDK.Shutdown() and you should be good to go.

github-actions[bot] commented 3 weeks ago

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '