Skip to content

lease: add package for distributed locking via CockroachDB#24

Merged
sravotto merged 1 commit intomainfrom
sr8_lease
Mar 9, 2026
Merged

lease: add package for distributed locking via CockroachDB#24
sravotto merged 1 commit intomainfrom
sr8_lease

Conversation

@sravotto
Copy link
Contributor

@sravotto sravotto commented Mar 9, 2026

Package lease coordinates global, singleton activities using exclusive, time-based locks on named resources backed by CockroachDB.


This change is Reviewable

@bte-cockroachlabs
Copy link

This is neat stuff. What's the use case driving this? Curious what problem you're solving with it.

@sravotto
Copy link
Contributor Author

sravotto commented Mar 9, 2026

It's useful when multiple processes need to coordinate exclusive access to a shared resource, using CockroachDB as the backing store for time-based leases.

Copy link
Member

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

I tried to look at the changes you made, and not the rest of the code since we've already vetted it.

My only nit would be the formatting of the SQL files. Could you use a formatter on them?

@BramGruneir reviewed 11 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on sravotto).

Package lease coordinates global, singleton activities using exclusive,
time-based locks on named resources backed by CockroachDB.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@sravotto sravotto merged commit 3cfb0ae into main Mar 9, 2026
4 of 5 checks passed
@sravotto sravotto deleted the sr8_lease branch March 9, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants