Skip to content

Commit 03aa524

Browse files
committed
fix: correct race condition (#1160)
* fix: correct race condition * fix: make URL parsing test work with Go 1.16 From the release notes in Go 1.17: The net/url and net/http packages used to accept ";" (semicolon) as a setting separator in URL queries, in addition to "&" (ampersand). Now, settings with non-percent-encoded semicolons are rejected and net/http servers will log a warning to Server.ErrorLog when encountering one in a request URL. See "URL query parsing" in https://go.dev/doc/go1.17.
1 parent 273031c commit 03aa524

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/root_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestNewCommandWithErrors(t *testing.T) {
149149
},
150150
{
151151
desc: "when the query string is bogus",
152-
args: []string{"proj:region:inst?ke;y=b;ad"},
152+
args: []string{"proj:region:inst?%=foo"},
153153
},
154154
{
155155
desc: "when the address query param is empty",

internal/proxy/proxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ func NewClient(ctx context.Context, d Dialer, cmd *cobra.Command, conf *Config)
134134
var mnts []*socketMount
135135
pc := newPortConfig(conf.Port)
136136
for _, inst := range conf.Instances {
137-
go func(i InstanceConnConfig) {
137+
go func(name string) {
138138
// Initiate refresh operation
139-
d.EngineVersion(ctx, inst.Name)
140-
}(inst)
139+
d.EngineVersion(ctx, name)
140+
}(inst.Name)
141141
}
142142
for _, inst := range conf.Instances {
143143
m := &socketMount{inst: inst.Name}

0 commit comments

Comments
 (0)