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
sync subscribe()
Chris Lu3a57aef7a910
diff --git a/weed/messaging/msgclient/subscriber.go b/weed/messaging/msgclient/subscriber.goindex 926e193dd4..01e63df401 100644--- a/weed/messaging/msgclient/subscriber.go+++ b/weed/messaging/msgclient/subscriber.go@@ -4,6 +4,7 @@ import ("context""io""time"+ "sync""github.com/chrislusf/seaweedfs/weed/messaging/broker""github.com/chrislusf/seaweedfs/weed/pb/messaging_pb"@@ -97,11 +98,17 @@ func doSubscribe(subscriberClient messaging_pb.SeaweedMessaging_SubscribeClient,// Subscribe starts goroutines to process the messagesfunc (s *Subscriber) Subscribe(processFn func(m *messaging_pb.Message)) {+ var wg sync.WaitGroupfor i := 0; i < len(s.subscriberClients); i++ {if s.subscriberClients[i] != nil {- go doSubscribe(s.subscriberClients[i], processFn)+ wg.Add(1)+ go func() {+ defer wg.Done()+ doSubscribe(s.subscriberClients[i], processFn)+ }()}}+ wg.Wait()}func (s *Subscriber) Shutdown() {