Use -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3
The combination ServerAliveInterval=15,ServerAliveCountMax=3 causes the I/O errors to pop out after one minute of network outage. This is important but largely undocumented. If ServerAliveInterval option is left at default (so without the alive check), processes which experience I/O hang seem to sleep indefinitely, even after the sshfs gets reconnect'ed. I regard this a useless behavior.
In other words what happens on -o reconnect without assigning ServerAliveInterval is that any I/O will either succeed, or hang the application indefinitely if the ssh reconnects underneath. A typical application becomes entirely hung as a result. If you'd wish to allow I/O to return an error and resume the application, you need ServerAliveInterval=1 or greater.
The ServerAliveCountMax=3 is the default anyway, but I like to specify it for readability.
man 5 ssh_configfor more details, but the gist is that every 15 seconds ssh will send something like a 'keep-alive' ping every 15 seconds to make sure the computers are still responding to each other. If three consecutive pings fail (45 seconds), reconnect. – Wyatt Ward Jun 17 '18 at 19:22ServerAliveCountMax=3has a different meaning. If there is a failure, it will try reconnecting 3 more times and then give up. At some point retrying is futile, but that depends on the application. Then again, I think the man page could be more specific, there's different ways to interpret the way it's worded IMO. FWIW my specific problem went away after switching to ProtonVPN. I think it's also worth checking ssh configuration on the client and the server, they have separate options, so all you really need is-o reconnect– PJ Brunet Jun 18 '18 at 17:23sshfs#user@hostname:/path. – Soullivaneuh Apr 27 '20 at 21:54ServerAliveInterval 15in~/.ssh/configwork? – user21952-is-a-great-name Feb 04 '23 at 01:56