Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Feb 13, 2023

On an error, we call os.Exit(2). However, the defer for the locking client that saves the local locks is not called in such a case, which can leave the locks out of sync even if some of the operation fails. If we're going to exit early, be sure we close the lock client to avoid this problem.

Fixes #5055

On an error, we call `os.Exit(2)`.  However, the defer for the locking
client that saves the local locks is not called in such a case, which
can leave the locks out of sync even if some of the operation fails.
If we're going to exit early, be sure we close the lock client to avoid
this problem.
@bk2204 bk2204 marked this pull request as ready for review February 14, 2023 15:19
@bk2204 bk2204 requested a review from a team as a code owner February 14, 2023 15:19
Copy link
Member

@chrisd8088 chrisd8088 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the test, that explains a lot!

@bk2204 bk2204 merged commit b972e77 into git-lfs:main Feb 14, 2023
@bk2204 bk2204 deleted the local-locks-failure branch February 14, 2023 17:25
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.

Local locks aren't updated correctly when lock/unlock fails on some files

2 participants