Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support FUSE_INTERRUPT #14

Open
cberner opened this issue Sep 24, 2020 · 3 comments
Open

Support FUSE_INTERRUPT #14

cberner opened this issue Sep 24, 2020 · 3 comments

Comments

@cberner
Copy link
Owner

cberner commented Sep 24, 2020

No description provided.

@cberner cberner added this to the ABI 7.7 support milestone Sep 24, 2020
@wmanley
Copy link
Contributor

wmanley commented Mar 29, 2021

I think FUSE_INTERRUPT could work really well with an async API runner. It would look something like:

let in_flight = HashMap<RequestId, JoinHandle<()>>::new();
let future_cancellations = Set<RequestId>::new();
for req in requests {
    if future_cancellations.contains(req.request_id()) {
        future_cancellations.pop(req.request_id());
        continue;
    }
    match req.operation() {
        Interrupt(x) => in_flight.pop(x.cancelled_id()).abort() || future_cancellations.push(x.cancelled_id());
    }
    in_flight[req.request_id()] = tokio::spawn(|| {
        handler(req);
        in_flight.pop(req.request_id());
    });
}

So interrupted pending tasks would be aborted, and their futures dropped in response to FUSE_INTERRUPT messages. It fits naturally with the async API.

@cberner
Copy link
Owner Author

cberner commented Mar 30, 2021

Ya, agreed! I'd love to see an async implementation :)

@cberner
Copy link
Owner Author

cberner commented Jun 25, 2021

Note to self, for the future: I looked into implementing this in the current API, and it doesn't make sense. FUSE_INTERRUPT is for interrupting code that's hung in userspace. However, the current Filesystem interface takes &mut self so concurrent calls aren't possible. Revisit it after async is implemented

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

No branches or pull requests

2 participants