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

Fix only_one_running to support git content updates #41285

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Jun 23, 2021

Sometimes, git pull will replace a file with a new inode at the same path when updating file contents. This isn't compatible
with flock (which locks against the inode directly and not the filesystem path more generally). As a workaround, this PR updates only_one_running? to lock against a separate temporary file (derived from an MD5 hash of the filesystem path) instead.

Links

Testing story

Added test_replaced_file as a unit test that fails without this PR and passes with the fix.

Sometimes, `git pull` will replace a file with a new inode
at the same path when updating file contents. This isn't compatible
with `flock`, so we need to lock against a separate temporary file instead.
@wjordan wjordan requested a review from sureshc June 23, 2021 22:16
@wjordan wjordan merged commit ec8173a into staging Jun 29, 2021
@wjordan wjordan deleted the only_one_running_fix branch June 29, 2021 16:05
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.

None yet

2 participants