We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent91093d5 commite145cdeCopy full SHA for e145cde
provisionerd/provisionerd.go
@@ -177,7 +177,17 @@ func (p *Server) connect(ctx context.Context) {
177
p.opts.Logger.Warn(context.Background(),"failed to dial",slog.Error(err))
178
continue
179
}
180
+// Ensure connection is not left hanging during a race between
181
+// close and dial succeeding.
182
+p.mutex.Lock()
183
+ifp.isClosed() {
184
+client.DRPCConn().Close()
185
+p.mutex.Unlock()
186
+break
187
+}
188
p.clientValue.Store(client)
189
190
+
191
p.opts.Logger.Debug(context.Background(),"connected")
192
break
193
@@ -390,7 +400,8 @@ func retryable(err error) bool {
390
400
// is not retryable() or the context expires.
391
401
func (p*Server)clientDoWithRetries(
392
402
ctx context.Context,ffunc(context.Context, proto.DRPCProvisionerDaemonClient) (any,error)) (
393
-any,error) {
403
+any,error,
404
+) {
394
405
forretrier:=retry.New(25*time.Millisecond,5*time.Second);retrier.Wait(ctx); {
395
406
client,ok:=p.client()
396
407
if!ok {