You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the proxy receives a SIGTERM, it will close this server socket. This can result in the server.Accept() returning a non-nil error with the message
"proxy server error: accept tcp" or "use of closed network connection". This error will be put into the error channel, causing the process end with exit code 2, instead of the appropriate 143 (TERMINATED) or 0 (SUCCESS).
changed the title [-]This may result in an exit code error status[/-][+]Accept loop has improper error handling, causing wrong exit code.[/+]on Jan 21, 2025
My context is this: I'm using kubernetes and use cloud-sql-proxy in CronJobs, recently I've migrated just hosting a proxy in a container to a native sidecar (init container) and got a lot of errors, I thought it was related to the original reported error for SIGTERM, however I've missed that the proxy returns code 143 instead of 0 on SIGTERM, so I just needed to add a flag
Activity
[-]This may result in an exit code error status[/-][+]Accept loop has improper error handling, causing wrong exit code.[/+]hessjcg commentedon Apr 22, 2025
Still looking into this one.
hessjcg commentedon Aug 12, 2025
Keeping this on the backlog for now. We would like to resolve it.
eremeevfd commentedon Sep 19, 2025
@hessjcg thanks for opening the issue! we faced the same thing recently, did you find any workaround for now?
eremeevfd commentedon Sep 19, 2025
okay sorry, I found an answer myself
My context is this: I'm using kubernetes and use cloud-sql-proxy in CronJobs, recently I've migrated just hosting a proxy in a container to a native sidecar (init container) and got a lot of errors, I thought it was related to the original reported error for SIGTERM, however I've missed that the proxy returns code 143 instead of 0 on SIGTERM, so I just needed to add a flag
to make it work properly
hessjcg commentedon Sep 23, 2025
This is still a valid issue, but I'm moving it to a P3 for now since
--exit-zero-on-sigtermworks correctly under most circumstances.