fuse3 icon indicating copy to clipboard operation
fuse3 copied to clipboard

out of order execution

Open FlorianLudwig opened this issue 1 year ago • 1 comments

When running multiple commands it seems that they have to finish in order.

For example when running:

tokio::time::sleep(tokio::time::Duration::from_millis(100_000)).await;

in the implementation of one of the commands and triggering it, the whole file systems seem to come to a hold.

FlorianLudwig avatar Jul 08 '24 17:07 FlorianLudwig

I'm not sure if this is correct, but I guess it might be due to the characteristics of Fuse. The design pattern of the Fuse file system is based on an event-loop model, where all requests are scheduled to a single thread and processed sequentially. Achieving 100% parallelism might require you to manually create new threads?

Ivanbeethoven avatar Nov 12 '24 08:11 Ivanbeethoven

Hi I have mostly the same comment as OP

From everything I have read it is suggested that fuse version 3 has in its api support for asynchronous request-reply

I took path_memfs in examples/ and modified the create function to delay 10 seconds if the filename ends with .slow

I then run the example and mount to /tmp/fuse and:

In terminalA:

echo hi >> /tmp/fuse/slow.slow

In terminalB:

echo fast >> /tmp/fuse/fast

A blocks for 10 seconds and B blocks also and then A completes and B completes only after A

Additionally the example is running with full debug logs on

When the command in A runs there is a list of logs that show

But then I run command in B and not a single new log line is added until A completes

You can see in main.rs fn create the first three lines of code are

let path = parent.to_string_lossy();
let paths = split_path(&path);
debug!("create parent path {}, name {:?}", path, name);

There are no calls to await or anything here and I am seeing this log line does not show up until A completes also

The situation with this library fundamentally does not make sense to me

If anyone else has done reading on fuse version 3 and can comment confidently on this please do

I have also modified the example

Previously:

#[tokio::main(flavor = "current_thread")]

Now:

#[tokio::main]

And enabled rt-multi-thread in the Cargo.toml and my test process does exactly the same

Thanks for your attention

rhodey avatar Nov 09 '25 00:11 rhodey