Skip to content

[local storage] Remove IPC lock file after releasing the lock#2172

Open
Sanjays2402 wants to merge 1 commit into
apache:trunkfrom
Sanjays2402:fix/local-lock-file-cleanup
Open

[local storage] Remove IPC lock file after releasing the lock#2172
Sanjays2402 wants to merge 1 commit into
apache:trunkfrom
Sanjays2402:fix/local-lock-file-cleanup

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #1975

Description

fasteners.InterProcessLock creates its lock file but never removes it, and
LockLocalStorage.__exit__ did not remove it either. The file name is a sha256
of the locked path, so one file was left behind in the temp directory for every
distinct path ever locked -- a long running process writing many objects can
exhaust inodes. The lock file is now removed after the IPC lock is released.

Status

done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

fasteners.InterProcessLock creates its lock file but never removes it, and
LockLocalStorage did not remove it either. Because the file name is derived
from a sha256 of the locked path, one file was left behind in the temporary
directory for every distinct path ever locked, which can exhaust inodes on
long running processes that write many objects.

The lock file is now removed after the IPC lock is released.

Closes apache#1975
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.

Improper lock usage leads to inode overflow in LockLocalStorage implementation

1 participant