[PR #2478] [MERGED] Fixed a deadlock in the FdManager::ChangeEntityToTempPath method call #2563

Closed
opened 2026-03-04 02:06:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2478
Author: @ggtakec
Created: 6/23/2024
Status: Merged
Merged: 6/30/2024
Merged by: @gaul

Base: masterHead: fix_deadlock


📝 Commits (1)

  • 1c3acb5 Fixed a deadlock in the FdManager::ChangeEntityToTempPath method call

📊 Changes

3 files changed (+57 additions, -12 deletions)

View changed files

📝 src/fdcache.cpp (+51 -10)
📝 src/fdcache.h (+4 -1)
📝 src/fdcache_entity.h (+2 -1)

📄 Description

Relevant Issue (if applicable)

#2438 #2463

Details

Fixed a bug that caused a deadlock during simultaneous processing such as file uploads from multiple threads when there was not enough cache space.

The FdManager class manages object paths and FdEntity in a map, but when there is not enough cache space, there is a process that changes the object path of that entry.
For this process, the FdManager object is operated from the FdEntity method.
At this time, a deadlock occurred.

As a currently solution, we delayed the operation rather than directly operating the map object when calling the process to change the object path.

@gaul
I think this is the best solution at the moment.
We are also considering adding test cases, but it may be difficult.
(Due to the issue of whether we can reliably create a timing that causes the bug to occur.)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/2478 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 6/23/2024 **Status:** ✅ Merged **Merged:** 6/30/2024 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_deadlock` --- ### 📝 Commits (1) - [`1c3acb5`](https://github.com/s3fs-fuse/s3fs-fuse/commit/1c3acb5b6d4ef5e612890a0ac3b5b9d6a9faebaf) Fixed a deadlock in the FdManager::ChangeEntityToTempPath method call ### 📊 Changes **3 files changed** (+57 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/fdcache.cpp` (+51 -10) 📝 `src/fdcache.h` (+4 -1) 📝 `src/fdcache_entity.h` (+2 -1) </details> ### 📄 Description ### Relevant Issue (if applicable) #2438 #2463 ### Details Fixed a bug that caused a deadlock during simultaneous processing such as file uploads from multiple threads when there was not enough cache space. The FdManager class manages object paths and FdEntity in a map, but when there is not enough cache space, there is a process that changes the object path of that entry. For this process, the FdManager object is operated from the FdEntity method. At this time, a deadlock occurred. As a currently solution, we delayed the operation rather than directly operating the map object when calling the process to change the object path. @gaul I think this is the best solution at the moment. We are also considering adding test cases, but it may be difficult. (Due to the issue of whether we can reliably create a timing that causes the bug to occur.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:06:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#2563
No description provided.