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

Reverse error checking logic to make sure lock errors are logged #1689

Merged
merged 1 commit into from Jun 29, 2022

Conversation

KevinGreen
Copy link
Contributor

Noticed this potential issue while reading through this code. Due to how the flock library will set always return (false, err) this code wouldn't print other lock errors since it would always hit the first branch. This flips the logic to make sure the err is checked first then falls through when the more typical case of the lock being held by someone else most of the time. gofrs/flock will never return (true, err): https://github.com/gofrs/flock/blob/master/flock_unix.go#L158

@moskyb moskyb enabled auto-merge June 29, 2022 22:48
@moskyb moskyb merged commit b702c44 into buildkite:main Jun 29, 2022
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