SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix: WaitUntilConnected now respects context cancellation during sleep (#7737)
Chris Lueb860752e6c0
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.goindex 89218a8c77..81de308947 100644--- a/weed/wdclient/masterclient.go+++ b/weed/wdclient/masterclient.go@@ -367,7 +367,14 @@ func (mc *MasterClient) WaitUntilConnected(ctx context.Context) {if attempts%100 == 0 { // Log every 100 attempts (roughly every 20 seconds)glog.V(0).Infof("%s.%s WaitUntilConnected still waiting for master connection (attempt %d)...", mc.FilerGroup, mc.clientType, attempts)}- time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond)+ // Use select with time.After to respect context cancellation during sleep+ sleepDuration := time.Duration(rand.Int31n(200)) * time.Millisecond+ select {+ case <-ctx.Done():+ return+ case <-time.After(sleepDuration):+ // continue to next iteration+ }}}}