-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
priority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Feature Description
When performing an explicit TLS handshake, use the HandshakeContext method introduced in Go 1.17 instead of Handshake. The difference is that HandshakeContext will respect context deadlines or cancelation.
In a previous iteration of this connector (cloud-sql-proxy), we an issue where Handshake could hang for minutes (like five minutes): GoogleCloudPlatform/cloud-sql-proxy#986.
Alternatives Considered
I am not able to come up with a workaround as the standard library method Handshake is not cancelable (so the goroutine is hung no matter what we do).
Additional Context
Equivalent fix in cloud-sql-proxy: GoogleCloudPlatform/cloud-sql-proxy#987
Handshake line in this repo:
cloud-sql-go-connector/dialer.go
Line 231 in 2a88f23
| if err := tlsConn.Handshake(); err != nil { |
Metadata
Metadata
Assignees
Labels
priority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.