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

feat(sns): Add simple global lock for the periodic task that relates to upgrades #2193

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

anchpop
Copy link
Contributor

@anchpop anchpop commented Oct 22, 2024

What

This PR adds a lock around checking the upgrade status and refreshing the cached upgrade steps. This ensures that they do not interleave with one another (or themselves).

Why

This is useful because it simplifies our reasoning about any logic that may be impacted by such an interleaving.

Additional Notes

This implementation is not ideal, because we attempt to acquire the lock unconditionally, which means that in cases where the lock was acquired it's impossible to say why. And in the unlikely even that the lock is not released, it would be useful to know what actual work necessitated it be acquired. #2124 builds upon this PR to create a more robust locking mechanism.

@anchpop anchpop requested a review from a team as a code owner October 22, 2024 21:18
@github-actions github-actions bot added the feat label Oct 22, 2024
@anchpop anchpop force-pushed the @anchpop/basic-upgrade-tech branch from 8aea53b to 6026877 Compare October 22, 2024 21:56
@anchpop anchpop force-pushed the @anchpop/basic-upgrade-tech branch from 6026877 to f5f9405 Compare October 22, 2024 22:01
@anchpop anchpop force-pushed the @anchpop/basic-upgrade-tech branch 3 times, most recently from 335cd84 to 2b8b01f Compare October 25, 2024 00:46
@anchpop anchpop force-pushed the @anchpop/basic-upgrade-tech branch from 2b8b01f to 419bcd0 Compare October 25, 2024 00:51
@anchpop anchpop added this pull request to the merge queue Oct 25, 2024
Merged via the queue into master with commit 34ab896 Oct 25, 2024
25 checks passed
@anchpop anchpop deleted the @anchpop/basic-upgrade-tech branch October 25, 2024 01:47
nmattia pushed a commit that referenced this pull request Oct 25, 2024
…to upgrades (#2193)

## What

This PR adds a lock around checking the upgrade status and refreshing
the cached upgrade steps. This ensures that they do not interleave with
one another (or themselves).

## Why

This is useful because it simplifies our reasoning about any logic that
may be impacted by such an interleaving.

## Additional Notes

This implementation is not ideal, because we attempt to acquire the lock
unconditionally, which means that in cases where the lock was acquired
it's impossible to say why. And in the unlikely even that the lock is
not released, it would be useful to know what actual work necessitated
it be acquired. #2124 builds upon this PR to create a more robust
locking mechanism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants