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

Make state initialization concurrency safe #285

Merged
merged 4 commits into from
Feb 26, 2024
Merged

Conversation

andrew-farries
Copy link
Collaborator

Make pgroll state initialization concurrency safe by using Postgres advisory locking to ensure at most one connection can initialize at at time.

See docs on Postgres advisory locking:

Closes #283

@andrew-farries andrew-farries changed the title Protect against concurrent state iniitialization Make state initialization concurrency safe Feb 22, 2024
pkg/state/state.go Show resolved Hide resolved
@andrew-farries andrew-farries merged commit b4e3044 into main Feb 26, 2024
42 checks passed
@andrew-farries andrew-farries deleted the advisory-lock-init branch February 26, 2024 09:04
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.

Improve locking around pgroll initialization
3 participants