Skip to content

Commit

Permalink
Merge pull request portworx#129 from portworx/pwx37961
Browse files Browse the repository at this point in the history
PWX-37961: In unlock don't write to the channel
  • Loading branch information
pnookala-px authored Jul 25, 2024
2 parents 5ea66d8 + 5dd2367 commit 04161af
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 04161af

Please sign in to comment.