Skip to content

Commit 380f665

Browse files
authored
Unlocked deadlocks inside nil-check conditions (#1029)
1 parent 497d1f1 commit 380f665

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/command/command_service.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (cs *CommandService) UpdateDataPlaneStatus(
101101

102102
cs.subscribeClientMutex.Lock()
103103
if cs.commandServiceClient == nil {
104+
cs.subscribeClientMutex.Unlock()
104105
return nil, errors.New("command service client is not initialized")
105106
}
106107
response, updateError := cs.commandServiceClient.UpdateDataPlaneStatus(ctx, request)
@@ -378,6 +379,7 @@ func (cs *CommandService) dataPlaneHealthCallback(
378379

379380
cs.subscribeClientMutex.Lock()
380381
if cs.commandServiceClient == nil {
382+
cs.subscribeClientMutex.Unlock()
381383
return nil, errors.New("command service client is not initialized")
382384
}
383385

0 commit comments

Comments
 (0)