GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-proxy

Accept loop has improper error handling, causing wrong exit code.

Open
#2,372 5 comments 7 reactions 1 assignee Assigned to @hessjcg View on GitHub
priority: p3 type: bug
Dominant language
Go
Stars
1.4k
Forks
352
Avg merge
14h 54m
Merged PRs (30d)
5

Description

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).

See https://github.com/GoogleCloudPlatform/cloud-sql-proxy/blob/main/cmd/root.go#L1143

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.