Skip to content

Commit

Permalink
fix deadlock in approver
Browse files Browse the repository at this point in the history
  • Loading branch information
jcodybaker committed Feb 19, 2024
1 parent b308e9c commit 6e2d076
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/discovery/approve.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ func (a *approver[T]) confirm(ctx context.Context, d *provisionalDevice[T]) erro
// canceled and the other approver didn't close the stop chan.
select {
case <-ctx.Done():
a.ioLock.Unlock()
return ctx.Err()
case <-a.stop:
a.ioLock.Unlock()
return nil
default:
}
Expand Down

0 comments on commit 6e2d076

Please sign in to comment.