Skip to content

Commit 426525b

Browse files
authored
PWX-30114: Handling error in store_kv (#143)
When a lock reaches tryDuration, it returns and error that the key already exists. It was not being returned. Signed-off-by: Naveen Revanna <nrevanna@purestorage.com>
1 parent 91f58d3 commit 426525b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

store/store_kv.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ func (kv *kvStore) getFullLockPath(key string) string {
9090
func (kv *kvStore) LockWithKey(owner, key string) (*Lock, error) {
9191
fullPath := kv.getFullLockPath(key)
9292
kvPair, err := kv.lockWithKeyHelper(owner, fullPath)
93+
if err != nil {
94+
return nil, err
95+
}
9396
kvPair.lockedWithKey = true
9497
return kvPair, err
9598
}

0 commit comments

Comments
 (0)