Skip to content

Fix POSIX duplicate lock attempts releasing existing locks - #1372

Open
asxxb wants to merge 1 commit into
google:mainfrom
asxxb:fix/posix-lockfile-duplicate-open
Open

asxxb wants to merge 1 commit into
google:mainfrom
asxxb:fix/posix-lockfile-duplicate-open

Conversation

@asxxb

@asxxb asxxb commented Oct 13, 2026

Copy link
Copy Markdown

Summary

  • Reserve the lock filename before opening the lock file to prevent duplicate lock attempts from releasing an existing process-associated fcntl lock.
  • Close the file descriptor before removing the filename reservation in UnlockFile() to avoid a race with concurrent lock attempts.
  • Add a regression test verifying that a duplicate lock attempt does not release the original OS-level lock.

Testing

  • Build completed successfully.
  • POSIX environment tests passed (8 tests).
  • Full LevelDB test suite passed (210 passed, 2 skipped).
  • git diff --check passed.
@google-cla

google-cla Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@asxxb
asxxb force-pushed the fix/posix-lockfile-duplicate-open branch from ea73ca2 to 5c9bf0b Compare October 13, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant