Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a lock should reliably fail when the pool contains a lock by that name #27

Open
jaresty opened this issue Mar 21, 2017 · 3 comments
Labels

Comments

@jaresty
Copy link

jaresty commented Mar 21, 2017

You can get a pool into a bad state where it has a lock by the same name in both the claimed and the unclaimed state. You do this by adding a lock with a name that matches the name of an existing lock, but adding it the opposite state of claimedness from the existing lock.

For example, you if you have a pool with a claimed lock called knox, and you add an unclaimed lock called knox, it will happily create and ruin your pool.

If you try to add a lock to a pool and state that already contains a lock by that name, it will fail to add (and retry). It gives the following (obscure) output:

adding unclaimed lock: luna to pool: cf-deployment/fresh
failed to add the lock: luna! (err: exit status 1) retrying...
failed to add the lock: luna! (err: exit status 1) retrying...
failed to add the lock: luna! (err: exit status 1) retrying...
failed to add the lock: luna! (err: exit status 1) retrying...

We'd prefer it if, instead, it said something like this in both cases:

adding unclaimed lock: luna to pool: cf-deployment/fresh
failed to add lock: luna; A lock by this name already exists in this pool. retrying...

Would you be open to receiving a pull request that implemented this?

Signed-off by: @anEXPer

@concourse-bot
Copy link
Collaborator

Hi there!

We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

The current status is as follows:

  • #142188851 Adding a lock should reliably fail when the pool contains a lock by that name

This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

@jtarchie
Copy link

@jaresty, how are you creating a lock with the same name in the claim and unclaim pools? Please clarify what your jobs were doing and how they interacted with the locks.

@jaresty
Copy link
Author

jaresty commented Aug 29, 2017

Hi @jtarchie,

  • We already had an unclaimed lock named luna cf-deployment/fresh/unclaimed/luna
  • We accidentally ran a task that uses the pool resource to "add_claimed: luna", which would go in cf-deployment/fresh/claimed/luna. We would expect this to fail, but it did not. After the task succeeded, we could no longer use the pool without manually deleting one of the luna locks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants