diff options
| author | Chris Lu <chris.lu@gmail.com> | 2025-10-20 22:22:15 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2025-10-20 22:22:15 -0700 |
| commit | d989971f3e779424ee1c4680e72dee3212acb993 (patch) | |
| tree | c04c32894c805724d8f6a4f3f98b29acb242eb8d | |
| parent | 479e7bc38ba05422df248feef32869e8a59851a0 (diff) | |
| parent | 34054ed91031479a61f8f83795413ef45566d1b3 (diff) | |
| download | seaweedfs-d989971f3e779424ee1c4680e72dee3212acb993.tar.xz seaweedfs-d989971f3e779424ee1c4680e72dee3212acb993.zip | |
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs
| -rw-r--r-- | weed/worker/client.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/worker/client.go b/weed/worker/client.go index a90eac643..9066afdf3 100644 --- a/weed/worker/client.go +++ b/weed/worker/client.go @@ -74,11 +74,12 @@ func NewGrpcAdminClient(adminAddress string, workerID string, dialOption grpc.Di // Connect establishes gRPC connection to admin server with TLS detection func (c *GrpcAdminClient) Connect() error { c.mutex.Lock() - defer c.mutex.Unlock() - if c.connected { + c.mutex.Unlock() return fmt.Errorf("already connected") } + // Release lock before calling attemptConnection which needs to acquire locks internally + c.mutex.Unlock() // Always start the reconnection loop, even if initial connection fails go c.reconnectionLoop() |
