-
Notifications
You must be signed in to change notification settings - Fork 350
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
Proxy exits with wrong code after SIGTERM #1529
Comments
Thanks for the issue @cdaguerre. Looking at these exit codes again, I see that SIGTERM is conventionally 143 and SIGKILL is 137. I think what this means is that we should be returning exit code 143 instead of 137 here: https://github.com/GoogleCloudPlatform/cloud-sql-proxy/blob/main/cmd/errors.go#L29. Cf. https://komodor.com/learn/sigterm-signal-15-exit-code-143-linux-graceful-termination/ Is that your expectation? |
Hey @enocom Basically, ideal behaviour to gracefully terminate on
EDIT: added link to v1 code: cloud-sql-proxy/proxy/proxy/client.go Line 630 in 6af6a92
|
Thanks for the clarification. There are two issues here:
Since we've made this worse in v2 with the new non-0 exit code, I'll prioritize adding a |
SIGTERM (15) is 128+15=143 (not 137). See https://tldp.org/LDP/abs/html/exitcodes.html and https://komodor.com/learn/exit-codes-in-containers-and-kubernetes-the-complete-guide/ for details. Fixes #1529.
Hey @enocom Just to dig up this issue again, it seems that we're hitting the same behaviour that @cdaguerre mentions here despite having no open connections (exit code: 143) We use
Prior to v2, this behaved gracefully as expected. Happy to open as a new issue if you'd prefer. |
We recently added support for a |
Bug Description
Graceful termination seems impossible in v2. Whether I set
--max-sigterm-delay
or not doesn't matter, process always has exit code137
, even when there are no active connections.Example code (or command)
Stacktrace
How to reproduce
Environment
./cloud-sql-proxy --version
): 2.0.0-preview.2The text was updated successfully, but these errors were encountered: