Skip to content

Commit

Permalink
PWX-33631: Remove global lock on getRemoteConn
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Griffiths <[email protected]>
  • Loading branch information
Grant Griffiths committed Sep 14, 2023
1 parent 6b9d48d commit 86a089c
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions csi/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,19 @@ type OsdCsiServer struct {
csi.IdentityServer

*grpcserver.GrpcServer
cloudBackupClient func(cc grpc.ClientConnInterface) api.OpenStorageCloudBackupClient
specHandler spec.SpecHandler
driver volume.VolumeDriver
cluster cluster.Cluster
sdkUds string
sdkPort string
conn *grpc.ClientConn
roundRobinBalancer loadbalancer.Balancer
nextCreateNodeNumber int
mu sync.Mutex
csiDriverName string
allowInlineVolumes bool
stopCleanupCh chan bool
config *OsdCsiServerConfig
autoRecoverStopCh chan struct{}
cloudBackupClient func(cc grpc.ClientConnInterface) api.OpenStorageCloudBackupClient
specHandler spec.SpecHandler
driver volume.VolumeDriver
cluster cluster.Cluster
sdkUds string
sdkPort string
conn *grpc.ClientConn
mu sync.Mutex
csiDriverName string
allowInlineVolumes bool
roundRobinBalancer loadbalancer.Balancer
config *OsdCsiServerConfig
autoRecoverStopCh chan struct{}
}

// NewOsdCsiServer creates a gRPC CSI complient server on the
Expand Down Expand Up @@ -163,9 +161,6 @@ func (s *OsdCsiServer) getConn() (*grpc.ClientConn, error) {
}

func (s *OsdCsiServer) getRemoteConn(ctx context.Context) (*grpc.ClientConn, error) {
s.mu.Lock()
defer s.mu.Unlock()

remoteConn, _, err := s.roundRobinBalancer.GetRemoteNodeConnection(ctx)
return remoteConn, err
}
Expand Down

0 comments on commit 86a089c

Please sign in to comment.