mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: remove v3.WithFirstKey() in Barrier.Wait()
fix the unexpected blocking when using Barrier.Wait(), e.g. NewBarrier(client, "a").Wait() will block if key "a" is not existed but "a0" is existed, but it should return immediately. Signed-off-by: zhangwenkang <zwenkang@vmware.com>
This commit is contained in:
@@ -49,7 +49,7 @@ func (b *Barrier) Release() error {
|
||||
// Wait blocks on the barrier key until it is deleted. If there is no key, Wait
|
||||
// assumes Release has already been called and returns immediately.
|
||||
func (b *Barrier) Wait() error {
|
||||
resp, err := b.client.Get(b.ctx, b.key, v3.WithFirstKey()...)
|
||||
resp, err := b.client.Get(b.ctx, b.key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user