Skip to content

Release the thread lock when IPC acquisition fails - #2203

Open
zhechen-cs wants to merge 1 commit into
apache:trunkfrom
zhechen-cs:codex/local-lock-acquisition-cleanup
Open

zhechen-cs wants to merge 1 commit into
apache:trunkfrom
zhechen-cs:codex/local-lock-acquisition-cleanup

Conversation

@zhechen-cs

Copy link
Copy Markdown

Description

Release the thread lock when LockLocalStorage cannot acquire its IPC lock. A failed __enter__ never reaches __exit__, so the previous code left the thread lock held after a timeout, acquisition error or interruption, preventing reuse of the same lock object.

Regression coverage verifies cleanup and successful reuse after each failure, while preserving the original exceptions. This is independent of the lock-file cleanup in #2172.

Fixes #2202

Status

Ready for review.

Validation

  • Local and base storage tests: 33 passed, 3 subtests passed (Python 3.12).
  • All three regression cases fail on unmodified production code because the thread lock stays held.
  • Black, isort, flake8, pylint and git diff --check pass for the changed files.
  • Live cloud integration tests were not run.

Checklist

  • Code linting
  • Documentation (no public API change)
  • Tests
  • ICLA (small bug fix)

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 storage retains its thread lock after IPC acquisition fails

1 participant