concourse / concourse/pool-resource

Support Freeing Locks held beyond some threshhold

Open
#39 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
59
Forks
39
PR merge metrics
No merged PRs in 30d

Description

We have forked this resource to support a "max_minutes" attribute used to (unceremoniously) move claimed locks back to unclaimed if it is held for longer than this threshold. Perhaps this would be a desirable feature in the standard resource. We perform this clean-up as follows

1- Perform cleanup from "check" since the ATC runs only a single instance of this at a time
2- Check the timestamp of the last commit that touched this lock
3- If the max_minutes threshold is exceeded, unclaim the lock
3b- If the "unclaim" operation fails due to a (very possible) conflict, do not retry until the next check (to keep check running relatively quickly)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the resource's check operation and how it reads lock timestamps and performs unclaiming. Implement the max_minutes behavior described in the issue, including skipping retries after a conflict until the next check. Done means locks older than the threshold are returned to the unclaimed state without making check slow.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.