Skip to content

Serialize concurrent local storage uploads across threads - #2251

Open
khushalx wants to merge 1 commit into
apache:trunkfrom
khushalx:codex/local-storage-shared-thread-lock
Open

khushalx wants to merge 1 commit into
apache:trunkfrom
khushalx:codex/local-storage-shared-thread-lock

Conversation

@khushalx

@khushalx khushalx commented Dec 1, 2026

Copy link
Copy Markdown

Serialize local uploads across threads

Description

Fixes #2250.

Local uploads create separate lock instances for the same object. Their independent thread locks let two writers enter together on POSIX, potentially mixing file contents. Share the thread lock for each path and hold it until the IPC lock is released. Unused locks are collected, and forked children start with fresh thread locks.

The two original regression tests failed before the fix. Validation: the full suite passed (7,066 tests), including the storage suite; pre-commit checks passed using Python 3.12. A concurrent stream-upload reproduction and a fork check also passed.

AI disclosure: Codex (GPT-6) reproduced the bug, implemented the fix, wrote the tests and prepared this description.

Status

Ready for review.

Checklist

  • Code linting
  • Changelog
  • Tests

Share per-path thread locks across lock instances, retain them through IPC release, and reset the weak registry after fork.

Assisted-by: Codex:GPT-6
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 does not serialize concurrent uploads from separate threads

1 participant