You are not logged in.

#1 2016-01-21 18:02:21

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Unavailable sshfs mount point = apps freeze for ~10-20 seconds

I have a couple of sshfs mounts to my local server/NAS, today I shut it down for maintenance while one of my linux PCs was on, and now nearly every application hangs for 10-20 seconds after any browsing action.
The mounts are as follows:

myuser@192.168.178.2:/data/SomeShare           /home/myuser/SomeShare       fuse.sshfs      nofail,x-systemd.automount,idmap=user,_netdev,identityfile=/home/myuser/.ssh/id_rsa,allow_other,default_permissions,uid=1000,gid=1000,umask=0,reconnect,cache=no,kernel_cache,ciphers=arcfour,compression=no

What I'm used to is the mount point simply returning an error on access and doesn't affect browsing otherwise if it's not mounted.
Is there a way to make it work like that in this case as well?


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#2 2016-01-22 05:32:28

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Maybe give autofs a try?

Offline

#3 2016-01-22 21:04:13

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Doesn't seem like it's going to help me, as the wiki says the following about mounting to a specific folder:

Note: This can cause problems with resources getting locked if the connection to the share is lost. When trying to access the folder, programs will get locked into waiting for a response, and either the connection has to be restored or the process has to be forcibly killed before unmounting is possible. To mitigate this, only use if you will always be connected to the share, and do not use your home folder or other commonly used folders lest your file browser reads ahead into the disconnected folder

Which is exactly the situation I'm in without autofs atm. Is linux really that... un-robust when it comes to losing the connection to a share?


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#4 2016-01-23 01:07:15

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Is linux really that... un-robust when it comes to losing the connection to a share?

At least sshfs, apparently.
I had similar issues with my local Raspberry Pi sharing /srv, so I switched to editing all the files locally and pushing them via a custom vim command.
Obviously this is not an option for you, but have you tried any other solution, such as NFS?

Offline

#5 2016-01-23 12:24:24

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

The same issue happens with samba, it seems to be related to x-systemd.automount. I guess it just stubbornly attempts to mount the share every time something accesses it...


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#6 2016-01-23 12:48:37

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

If it was only, x-systemd.automount, it could be simply disabled.
Though, at least for the connection to my Raspberry Pi, I never had that enabled - 'noauto' was sufficient due to my lesser needs.

However, if you believe this setting to be the culprit, you could test if switching to noauto and automounting the share upon login helps.

Actually I could even imagine, that systemd's automount will help in case the connection is broken by trying to remount the share properly.
I was sometimes forced to kill the sshfs process before being able to remount the shared folder.

By the way:

systemd.automount(5)
       TimeoutIdleSec=
           Configures an idle timeout. Once the mount has been idle for the
           specified time, systemd will attempt to unmount. Takes a
           unit-less value in seconds, or a time span value such as "5min
           20s". Pass 0 to disable the timeout logic. The timeout is
           disabled by default.

Possibly changing this to a lower value may also help.
Though you would probably have to create a custom automount unit.

Offline

#7 2016-01-23 16:09:34

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

That only applies for idling, though, not when the mount point is already dead. I've tried setting

x-systemd.device-timeout=
Configure how long systemd should wait for a device to show up before giving up on an entry from /etc/fstab. Specify a time in seconds or explicitly append a unit such as "s", "min", "h", "ms".

Note that this option can only be used in /etc/fstab, and will be ignored when part of the Options= setting in a unit file.

But it's not working. I get the same hangs once the mount point dies.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#8 2016-01-23 16:30:33

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

I thought a missing connection might be count as idling, since no data can be transferred.

By the way, you assumed, x-systemd.automount would try to mount the filesystem, which implies that it has been properly unmounted before.
Is this true?
To me, it sounds rather unlikely, since any process operating on it, i.e. a shell with $PWD inside the filesystem should prevent that. And if there are programs hanging due to this, I suspect they use the filesystem.
Or am I somehow wrong?

Offline

#9 2016-01-23 19:21:40

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Yes, as I wrote in my opening post, the connection to the server the share is located on goes down because it shuts down. So yes, it was mounted successfully, then loses connections.
Starting e.g. dolphin will hang with an empty window until it (or systemd.automount) gives up on trying to mount the share. Attempting to open any shares will result in another freeze. So it doesn't affect just the programs that were already running when the connection went down.

Last edited by Soukyuu (2016-01-23 19:22:25)


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#10 2016-01-23 19:35:36

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Losing the connection does not imply the proper unmounting of inaccessible remote filesystems.
So, just to confirm, is the filesystem not loger listed in /proc/self/mounts?

Have you tried, whether disabling systemd.automount helps?
E.g. by disabling the associated automount unit, probably home-myUser-someShare.automount?

Offline

#11 2016-01-24 10:39:19

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

I removed x-systemd.automount and set noauto. I now have to manually mount the share at every boot, however if the connection goes down, the same thing happens. So it's not related to automount, and probably not a mounting problem per se, but the way sshfs and samba handle a dropped connection.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#12 2016-01-24 10:49:52

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

So I assume the share is still perceived as mounted by the OS, which means that the only workaround is to forcibly unmount it, by killing the respective sshfs process and possibly regularly `umount'-ing the mountpoint afterwards.

By the way, have you tried x33a's suggestion? It looks promising to me.

Offline

#13 2016-01-24 10:52:27

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

I replied to his suggestion, the wiki explicitly states my use case as one causing the same freezes I'm getting now.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#14 2016-01-24 12:17:44

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Sorry, I must have somehow skipped your reply.

Oh, and after doing what one should have already done in the beginning, a quick web-search, I found this:
https://serverfault.com/questions/30679 … connection

EDIT: Sorry, it seems like you already use the reconnect option.

Last edited by respiranto (2016-01-24 12:22:36)

Offline

#15 2016-01-24 21:49:02

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: Unavailable sshfs mount point = apps freeze for ~10-20 seconds

Yes, I am. There is no issue with reconnecting once the server is back up, the main problem is the behavior while the server is down.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

Board footer

Powered by FluxBB