restore FUSE reconnection after suspend and resume#283
Conversation
🤖 Augment PR SummarySummary: This PR fixes regressions in FUSE suspend/resume reconnects introduced by recent AFP reconnect hardening. Changes:
Technical Notes: Connection generation updates/reads are now atomic helpers, and attention threads release server refs safely after stale-generation checks. 🤖 Was this summary useful? React with 👍 or 👎 |
The FUSE suspend/resume operations got broken when we hardened AFP session reconnection recently. Keep a per-mount FUSE reconnect credential after the initial authenticated login, since the shared AFP server password cache is scrubbed for stateless session safety and resume commands do not carry a fresh password. Make DSI attention handling generation-aware by copying packets into the worker context and ignoring stale attentions from older connections before they can disconnect a newly resumed socket. Also register FPZzzzz as a blank-reply AFP command and initialize FUSE reconnect error reporting so suspend and resume diagnostics reflect real failures.
|
augment review |
Install an explicit SIGPIPE handler in afpfsd before any FUSE mount thread can run so pthread_kill(SIGPIPE) cannot terminate the daemon if libfuse has not installed its own handler yet. Keep using SIGPIPE only as the documented libfuse wakeup after fuse_exit(), allowing the FUSE thread's fuse_main() path to own unmount and session cleanup.
Add helper accessors for the AFP server connection generation counter and use them anywhere DSI snapshots or compares the value. This removes the data race between reconnect generation increments and detached attention handling, keeping stale-attention and stale-reply filtering reliable across reconnects.
|
@andylemin with this changeset, it should be easier and more consistent to run the FUSE tests locally prepare the environment as described in test/TESTS.md and invoke it like this I have attempted several times to create a CI job for the FUSE tests, but I'm pretty sure this is where we'd have to create our own self hosted runner to make it happen |
before, any file system operation on a suspended mount would reactivate it, but now only an explicit 'resume' command will cause it to wake up
on macOS we have to call umount directly, and cannot rely on afp_client unmount
|
|
Lots of great UX improvements |



The FUSE suspend/resume operations got broken when we hardened AFP session reconnection recently.
Keep a per-mount FUSE reconnect credential after the initial authenticated login, since the shared AFP server password cache is scrubbed for stateless session safety and resume commands do not carry a fresh password.
Make DSI attention handling generation-aware by copying packets into the worker context and ignoring stale attentions from older connections before they can disconnect a newly resumed socket.
Also register FPZzzzz as a blank-reply AFP command and initialize FUSE reconnect error reporting so suspend and resume diagnostics reflect real failures.
introduce explicit suspended flag for FUSE mounts: before, any file system operation on a suspended mount would reactivate it, but now only an explicit 'resume' command will cause it to wake up
Add FUSE client tests for suspend and resume, while improving the resilience, configurability, and documentation of the FUSE test runner.
Make a number of adjacent improvements and bug fixes: