Skip to content

A retried lock reports "already locked" when the caller is the one holding it #490

Description

@morphqdd

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions