lock posts to /lock/<pname> with allowed = [302, 409] and treats anything that is not 302 as "someone else owns it" (lib/baza-rb.rb:240). The POST goes through retry_on, which repeats it on 429 and above 499.
What happens: if the server takes the lock and the reply is lost, the retry hits a lock that now exists, gets 409, and the caller is told the name is taken by somebody else, when it is holding it itself.
POSTs=2 -> RuntimeError: Failed to lock "foo" product at x.org, it's already locked
The owner string is already in the request and would let the client tell the two cases apart; the 409 branch ignores it.
What should happen: a 409 on a retried lock whose owner matches should be treated as success, or lock should re-check ownership before declaring the name taken.
lockposts to/lock/<pname>withallowed = [302, 409]and treats anything that is not 302 as "someone else owns it" (lib/baza-rb.rb:240). The POST goes throughretry_on, which repeats it on 429 and above 499.What happens: if the server takes the lock and the reply is lost, the retry hits a lock that now exists, gets 409, and the caller is told the name is taken by somebody else, when it is holding it itself.
The
ownerstring is already in the request and would let the client tell the two cases apart; the 409 branch ignores it.What should happen: a 409 on a retried lock whose
ownermatches should be treated as success, orlockshould re-check ownership before declaring the name taken.