-
Notifications
You must be signed in to change notification settings - Fork 816
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
Health Check Callbacks #142
Comments
/cc @sylvainduchesne - I figure you would have some thoughts on this. This was the design I thought would combat some of your very valid concerns. I also expect your C++ is way better than mine, so would love your thoughts on how to do a callback in C++ (or if that even make sense) |
That seems reasonable. I pushed this tentative code for the cpp |
I was thinking about this over the weekend, and perhaps I was over thinking the problem. I think there is perhaps still some clarification needed around what it means to be |
Just at GDC, so haven't had too much time to look in depth (yet!) Some quick answers/feedback to your questions: Re: Health checking. The base level for a GameServer, if it become Unhealthy, it's currently up to a managing layer to do something about that (should likely document this better). Health check period won't be modifiable at runtime and we can restrict that at the Minor thing that I saw at first pass - I'd suggest taking the health check out of the SDK constructor and move it into some kind of I'll definitely go deeper - but overall I think this is going to work out well - just need to work out some of the finer details. |
Why isn't the Kubernetes native health and liveness feature used for this? |
Hope GDC went well. |
Reviewing old issues, and doing some cleanup. Since the SDK can now retrieve the GameServer configuration, and adjust health pings if needed I'm going to close this issue. Please feel free to reopen, or file a new ticket if this is inaccurate. |
Impetus
Right now the Health check
Ping
is very basic - it requires the sdk to do aHealth()
call within the timeframe that is configured via theGameServer
config.The issue with this is, that means that the game server code needs to know what the configuration is at the
GameServer
configuration level. If theGameServer
configuration ever changes, this means the game server binary and image will need to be recompiled and rebuilt. This is less than ideal.Design
I would suggest the following solution:
The
GameServer
container that run the gameserver binary is passed an environment variable (AGONES_HEALTH_PERIOD_SECONDS
) that is the configiredperiodSeconds
fromGameServer > health
.The SDK (for all languages) would have custom code that would parse the above environment variable, and run a callback every
AGONES_HEALTH_PERIOD_SECONDS / 2
. If the callback returnstrue
, then the SDK will send the manual ping.This takes away some of the control around how to run the Healh checking (i.e how to thread, etc), but would be far more convenient for users - and there is no reason we couldn't leave the more manual method if people so desired.
An example API in Go
Research
Questions
sdk.AddHealthCheck(func() bool)
. Thinking of leaving at single for now - simple to start with, and see how things go.The text was updated successfully, but these errors were encountered: