mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #2438] Deadlock for FdManager::fd_manager_lock && FdEntity::fdent_lock when write data concurrently #1199
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1199
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Roay on GitHub (Mar 27, 2024).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2438
s3fs version : master
The First :
s3fs_write -> 'autoent.GetExistFdEntity' -> 'FdManager::get()->GetExistFdEntity'
first lock: FdManager::fd_manager_lock [line: 659 in fdcache.cpp]
sec lock: FdEntity::fdent_lock [line: 361 in fdcache_entity.cpp]
The Second :
s3fs_write -> 'ent->Write()' -> 'WriteMixMultipart()' -> 'NoCacheLoadAndPost' -> 'ChangeEntityToTempPath'
first lock: FdEntity::fdent_lock [line: 2088 in fdcache_entity.cpp]
sec lock: FdManager::fd_manager_lock [line: 780 in fdcache.cpp]
@Roay commented on GitHub (Mar 27, 2024):
#Triggered fix deadlock in clean up cache
@amarjayr commented on GitHub (Jun 10, 2024):
@gaul apologies for the direct ping but any updates here? I've included a python script to reproduce the deadlock in #2463 (which I closed as duplicate).
I'm happy to submit a fix, but could use some guidance on the recommended solution.
@ggtakec commented on GitHub (Jun 23, 2024):
@Roay
Thank you for your detailed explanation.
@amarjayr
And also for providing the code for testing, thanks!
I checked the calling sequence you pointed out and confirmed the possibility of a deadlock.
It seems that a lot of checking is required to fix it, so please wait a little while. (Because there is an issue with the logic)
@ggtakec commented on GitHub (Jun 23, 2024):
@Roay @amarjayr
I have posted PR #2478 as a solution to this problem.
If you can test the problem with the source code, please try it.
Thanks in advance for your assistance.
@amarjayr commented on GitHub (Jun 24, 2024):
@ggtakec this fixes the repro provided in #2463.
Thanks for the quick turnaround!
@ggtakec commented on GitHub (Jun 25, 2024):
@amarjayr Thank you for your cooperation, letting us know that the issue has been resolved.
We expect the PR will be merged after review, please wait a little while until then.
@ggtakec commented on GitHub (Jul 1, 2024):
#2478 was merged, I closed this.
Thanks.