-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
There is buggy logic around a Dial
log message:
cloud-sql-go-connector/dialer.go
Lines 348 to 350 in fef405b
// Log if resolver changed the instance name input string. | |
if cn.String() != icn { | |
d.logger.Debugf(ctx, "resolved instance %s to %s", icn, cn) |
When Dial
is called with a DNS domain name as the icn
this logic message code path will always be executed (even if the domain name still points at the same instance) even when it shouldn't be.
The reason being that cn.String()
has additional formatting done to it:
cloud-sql-go-connector/instance/conn_name.go
Lines 41 to 44 in fef405b
func (c *ConnName) String() string { | |
if c.domainName != "" { | |
return fmt.Sprintf("%s -> %s:%s:%s", c.domainName, c.project, c.region, c.name) | |
} |
Example: If a user calls Dial
with the domain name example.com
as the icn
.
Then cn.String()
would always return example.com -> my-project:region:instance
and continuously log a debug message.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.