Skip to content

Commit

Permalink
Fix panic caused by concurrent writes to handshakes map
Browse files Browse the repository at this point in the history
  • Loading branch information
kthomas committed Aug 1, 2024
1 parent c4bd7be commit 1fddd16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/node/workload_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@ func (w *WorkloadManager) agentHandshakeTimedOut(id string) {
}

func (w *WorkloadManager) agentHandshakeSucceeded(workloadID string) {
w.poolMutex.Lock()
defer w.poolMutex.Unlock()

now := time.Now().UTC()
w.handshakes[workloadID] = now.Format(time.RFC3339)
}
Expand Down

0 comments on commit 1fddd16

Please sign in to comment.