Skip to content

Fix race condition - #650

Merged
aduffeck merged 21 commits into
opencloud-eu:mainfrom
aduffeck:fix-race-condition
Jun 9, 2026
Merged

aduffeck merged 21 commits into
opencloud-eu:mainfrom
aduffeck:fix-race-condition

Conversation

@aduffeck

Copy link
Copy Markdown
Member

Acquire the metadata lock directly in getAll() instead of delegating it to
list(). This ensures the lock is held while reading all xattrs and pushing
to the cache, preventing a race condition where a concurrent SetMultiple()
could cause stale, partially-written metadata to overwrite the cache.

(hopefully) fixes opencloud-eu/opencloud#2821

@aduffeck
aduffeck force-pushed the fix-race-condition branch from ae8fa30 to e0de130 Compare May 28, 2026 13:53
@aduffeck
aduffeck marked this pull request as draft May 29, 2026 07:07
@aduffeck
aduffeck force-pushed the fix-race-condition branch from 2abd8b4 to 58f832f Compare May 29, 2026 07:49
@aduffeck
aduffeck force-pushed the fix-race-condition branch 7 times, most recently from 361a687 to 3b12525 Compare June 3, 2026 07:40
@aduffeck
aduffeck force-pushed the fix-race-condition branch from 9195bc4 to 36f1d92 Compare June 3, 2026 12:07
@aduffeck
aduffeck force-pushed the fix-race-condition branch from 182963a to f85d1b3 Compare June 5, 2026 13:34
@aduffeck
aduffeck force-pushed the fix-race-condition branch from 3e8e738 to 4bf9c2a Compare June 8, 2026 08:45
@aduffeck
aduffeck marked this pull request as ready for review June 8, 2026 13:37
Comment thread pkg/storage/fs/posix/tree/tree.go Resolved
@aduffeck

aduffeck commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

@rhafer thanks for the review, all issues have been addressed.

@aduffeck
aduffeck merged commit 080f870 into opencloud-eu:main Jun 9, 2026
19 checks passed
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.

Error: stat:could not read child node: internal error: Missing parent ID on node and file gets dettached from updates

2 participants