Skip to content

Commit 37b79d0

Browse files
smheidrichNikratio
authored andcommitted
Docs: add section on interrupted connections
Also rename "SSHFS hangs" section to something more specific to differentiate it from this new section. Cf. issues #77 and #3.
1 parent 2f1147c commit 37b79d0

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

sshfs.rst

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ errors which will make programs like `mv(1)` attempt to actually move the
243243
file after the failed rename.
244244

245245

246-
SSHFS hangs
247-
~~~~~~~~~~~
246+
SSHFS hangs for no apparent reason
247+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248248

249249
In some cases, attempts to access the SSHFS mountpoint may freeze if
250250
no filesystem activity has occured for some time. This is typically
@@ -253,6 +253,34 @@ without SSHFS being informed about that. As a workaround, you can try
253253
to mount with ``-o ServerAliveInterval=15``. This will force the SSH
254254
connection to stay alive even if you have no activity.
255255

256+
257+
SSHFS hangs after the connection was interrupted
258+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259+
260+
By default, network operations in SSHFS run without timeouts, mirroring the
261+
default behavior of SSH itself. As a consequence, if the connection to the
262+
remote host is interrupted (e.g. because a network cable was removed),
263+
operations on files or directories under the mountpoint will block until the
264+
connection is either restored or closed altogether (e.g. manually).
265+
Applications that try to access such files or directories will generally appear
266+
to "freeze" when this happens.
267+
268+
If it is acceptable to discard data being read or written, a quick workaround
269+
is to kill the responsible ``sshfs`` process, which will make any blocking
270+
operations on the mounted filesystem error out and thereby "unfreeze" the
271+
relevant applications. Note that force unmounting with ``fusermount -zu``, on
272+
the other hand, does not help in this case and will leave read/write operations
273+
in the blocking state.
274+
275+
For a more automatic solution, one can use the ``-o ServerAliveInterval=15``
276+
option mentioned above, which will drop the connection after not receiving a
277+
response for 3 * 15 = 45 seconds from the remote host. By also supplying ``-o
278+
reconnect``, one can ensure that the connection is re-established as soon as
279+
possible afterwards. As before, this will naturally lead to loss of data that
280+
was in the process of being read or written at the time when the connection was
281+
interrupted.
282+
283+
256284
Mounting from /etc/fstab
257285
========================
258286

0 commit comments

Comments
 (0)