concourse / concourse/pool-resource

Adds support for weighted lock

Open
#35 0 comments 2 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

Description

Sometime a resource (as in lock management) can be split into sub-part. For example, Cloud Foundry quota, nodes in a distributed architecture, ...

So, it will be nice to support easily such kind of lock.

Proposal

Solution 1 : Pool metadata

Pool directory may contain metadata which describe pool & lock capacities. When acquired, lock weight may be specified and recorded into new file. When released, lock weight is read from same file.

Note: When lock weight isn't specified, all capacity is assumed.

Solution 2 : Multi acquire/release (simplest)

Users have to create enough locks as pool capacity. acquire now accepts a number (or adds acquire_count). A new count file is generated providing lock count (and/or a names file with lock names). Then, name.<index> and metadata.<index> are generated as existing.

release doesn't change signature but support new directory structure.

Workaround

Currently I use as enough lock as necessary.

But need:

  • to split into a reasonable amount of locks. For example, I divided my 10240 MB Cloud Foundry quota into 40 slots of 256 MB ; while static web component only requires 64 MB.
  • to add enough put to acquire/release (not also being sure how to arrange release in order to be sure they are all correctly release in all cases)

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 reading the existing acquire and release entry points and the current pool directory layout. Compare the proposed pool-metadata and multi-acquire/release approaches, then define the chosen behavior for weighted acquisition, release, and capacity tracking; done means the selected design is implemented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.