[PR #2119] [CLOSED] Make s3fs_flush async #2344

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2119
Author: @huntersman
Created: 2/21/2023
Status: Closed

Base: masterHead: asynchronous-flush


📝 Commits (1)

📊 Changes

1 file changed (+55 additions, -26 deletions)

View changed files

📝 src/s3fs.cpp (+55 -26)

📄 Description

When big file is multi uploading, s3fs will be blocked due to semaphore, we can not do anything until uploading finished. So I change s3fs_flush asynchronously.

I know it's not a good idea to flush asynchronously as #367 already pointed out, but if you want better performance, try it.

I am new to C++, maybe the code is not very good.

Relevant Issue (if applicable)

#2090

Details

A file is written through s3fs_writes3fs_flushs3fs_release. Use C++ thread to do part of s3fs_flush. Big file usually takes a lot of time to flush, so s3fs_release can't be called immediately, I use doRelease replaced it.


🔄 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/2119 **Author:** [@huntersman](https://github.com/huntersman) **Created:** 2/21/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `asynchronous-flush` --- ### 📝 Commits (1) - [`5feb1b5`](https://github.com/s3fs-fuse/s3fs-fuse/commit/5feb1b544de596077cc73189bdcd2eb023be8e9f) Update s3fs.cpp ### 📊 Changes **1 file changed** (+55 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs.cpp` (+55 -26) </details> ### 📄 Description When big file is multi uploading, s3fs will be blocked due to semaphore, we can not do anything until uploading finished. So I change `s3fs_flush` asynchronously. I know it's not a good idea to flush asynchronously as #367 already pointed out, but if you want better performance, try it. I am new to C++, maybe the code is not very good. <!-- -------------------------------------------------------------------------- Please describe the purpose of the pull request(such as resolving the issue) and what the fix/update is. --------------------------------------------------------------------------- --> ### Relevant Issue (if applicable) <!-- If there are Issues related to this PullRequest, please list it. --> #2090 ### Details <!-- Please describe the details of PullRequest. --> A file is written through `s3fs_write` → `s3fs_flush` → `s3fs_release`. Use C++ thread to do part of `s3fs_flush`. Big file usually takes a lot of time to flush, so `s3fs_release` can't be called immediately, I use `doRelease` replaced it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:05:02 +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#2344
No description provided.