Skip to content

chore: acquire lock for individual workspace transition #15883

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

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

stirby
Copy link
Collaborator

@stirby stirby commented Dec 16, 2024

When Coder is ran in High Availability mode, each Coder instance has a lifecycle executor. These lifecycle executors are all trying to do the same work, and whilst transactions saves us from this causing an issue, we are still doing extra work that could be prevented.

This PR adds a TryAcquireLock call for each attempted workspace transition, meaning two Coder instances shouldn't duplicate effort.

(cherry picked from commit 50ff06c)

When Coder is ran in High Availability mode, each Coder instance has a
lifecycle executor. These lifecycle executors are all trying to do the
same work, and whilst transactions saves us from this causing an issue,
we are still doing extra work that could be prevented.

This PR adds a `TryAcquireLock` call for each attempted workspace
transition, meaning two Coder instances shouldn't duplicate effort.

(cherry picked from commit 50ff06c)
@stirby stirby changed the title chore: acquire lock for individual workspace transition (#15859) chore: acquire lock for individual workspace transition (cherry pick #15859) Dec 16, 2024
@stirby stirby changed the title chore: acquire lock for individual workspace transition (cherry pick #15859) chore: acquire lock for individual workspace transition in 2.18 Dec 16, 2024
@stirby stirby changed the title chore: acquire lock for individual workspace transition in 2.18 chore: acquire lock for individual workspace transition Dec 16, 2024
@stirby stirby merged commit c5e8769 into release/2.18 Dec 16, 2024
37 checks passed
@stirby stirby deleted the patch-2.18-mem branch December 16, 2024 18:01
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