smb://hostname takes a very long time to react to network topology (incl. resolved ip address) changes
I've a setup where there are two network interfaces in my machine. Lets call then lan0
and vpn0
. When vpn0
is enabled, the network topology, routing and IP addresses that DNS server resolves change. So for example, if I resolve home.mydomain
on lan0
(vpn0
is disabled), IP address 192.168.1.1
is returned. If I resolve home.mydomain
with vpn0
up, the returned IP address is 100.64.0.1
. Both of these resolved addresses are within the subnet of the corresponding interface and refer to the exact same machine.
With this setup if run gio mount smb://home.mydomain/share
, it works great regardless of whether vpn0
is up or not. However, if the network topology changes in a way that makes the IP address obtained at the time of gio mount
invocation unreachable, the mount will hang and never recover. Here are some real-life examples how this can happen:
- I bring the
vpn0
interface down (i.e. turn off the VPN); - I connect to
home.mydomain
withvpn0
interface down, then enable VPN & switch from home wlan network to a phone hotspot.
If I then try to list files in e.g. nautilus, it takes a very long time (time scale of go reheat some dinner for lunch and eat it) before listing succeeds. It would be great if gvfs was swifter in its reaction in this sort of situation.