fuser icon indicating copy to clipboard operation
fuser copied to clipboard

Panic when calling BackgroundSession::join

Open madadam opened this issue 3 years ago • 1 comments

I'm sometimes experiencing panics like this when calling BackgroundSession::join:

called `Result::unwrap()` on an `Err` value: Os { code: 103, kind: ConnectionAborted, message: "Software caused connection abort" }

It seems that what triggers it is when the session is being joined and the mounted filesystem is being accessed more or less concurrently. I'm not sure whether this is a bug or not. I can imagine the error simply means the sending half of the internal channel has been closed, but I'm not sure. If that was the case, then this error should probably be handled inside Session::run. Or at least propagated to the caller of join so they can decide what to do with it.

madadam avatar Jun 15 '22 13:06 madadam

Since the Session loop doesn't know that Unmount has occurred until it tries and fails to communicate with the fuse device, an error is all but guaranteed. The first step should be to replace the panicking unwrap in join() with a simple log message. The next step should be to give the application a way to signal to the Session that a graceful stop is requested, so that we can avoid abusing the fuse device to communicate this information.

rarensu avatar Sep 16 '25 18:09 rarensu