Skip to content

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.

close grpc connections during errors

Chris Lue11e127d91c3
diff --git a/weed/util/grpc_client_server.go b/weed/util/grpc_client_server.go
index 5c08538dcb..c35a139708 100644
--- a/weed/util/grpc_client_server.go
+++ b/weed/util/grpc_client_server.go
@@ -19,7 +19,7 @@ var (
grpcClientsLock sync.Mutex
)
-func init(){
+func init() {
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 100
}
@@ -81,6 +81,7 @@ func WithCachedGrpcClient(ctx context.Context, fn func(*grpc.ClientConn) error,
grpcClientsLock.Lock()
delete(grpcClients, address)
grpcClientsLock.Unlock()
+ grpcConnection.Close()
}
return err