Skip to content

Commit

Permalink
PWX-37961: In unlock don't write to the channel
Browse files Browse the repository at this point in the history
Signed-off-by: pnookala-px <[email protected]>
  • Loading branch information
pnookala-px committed Jul 25, 2024
1 parent 5ea66d8 commit 5dd2367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion etcd/v3/kv_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ func (et *etcdKV) Unlock(kvp *kvdb.KVPair) error {
// the lock, so even if we have connection errors we don't
// need to report error.
if closeChan {
l.Done <- struct{}{}
// close the channel without writing to it. This avoid blocking on the Done channel
// indefinitely if the caller has gone away (example: due to double Unlock)
close(l.Done)
}
return nil
}
Expand Down

0 comments on commit 5dd2367

Please sign in to comment.