Samba mount does not drop on timeout
I'm somewhat of a Linux newbie (been tinkering with Linux for a decade, but rarely).
We have a Linux server hosting a service that publishes files out to a Windows machine running IIS. We're using Samba for the file transfer since the service expects a file path (not, for example, an FTP path).
We've found that if the service publishes while the Windows machine goes down for maintenance--never a planned synchronous event but it does happen--Samba does not break the mount. Instead, it just sort of hangs there, and if you try to unmount it, it says it can't do it because it's "busy".
More specifically, the service on the Linux machine was publishing files out when the Windows machine rebooted. The Samba connection was never restored, and half a day later we were all looking at it and trying to figure out why the service running on Linux was hung. The Linux guys said that the Samba path to one Windows server was up but the path to another Windows server was down. We rebooted the Windows server whose link was down, but that didn't help. We then observed that Samba's link wasn't unmounted and we couldn't unmount it and remount it. We looked at the Event Viewer on Windows and saw that the machine had been rebooted half a day prior, from which we concluded that Samba simply failed to unmount the link when Windows went down.
What can we do on Samba configuration-wise to get a proper timeout or connection error / exception to be raised on Linux, or to write to a temp path, rather than let it just hang there in a broken state indefinitely?