libsmb2 icon indicating copy to clipboard operation
libsmb2 copied to clipboard

how to handle disconnected target

Open kshanik opened this issue 4 years ago • 0 comments

I am working on an application where we mount window 10 share directories by forking a process and running mount cifs command. Now at some point if the window 10 machine is made hibernate/sleep and then we try to access the mounted directory application freezes for 120 sec. I have found a workaround way to create a thread and do the directory exist check and wait for 10 sec and kill the thread declaring a dead target. I am thinking of finding any alternative way to deal with this situation.

  1. I figured playing with echo_interval mount.cifs(8) may reduce the waiting time to about in 30 secs. But this requires kernel upgrade which is not an option for me at this moment.
  2. I can do polling and check for directory existence?
  3. ping to server IP at regular interval?

I was reading libsm2 and was thinking if it can provide notification as soon as mount point becomes non-reachable?

Or do we have any better way to handle. Please advice.

Thanks!

kshanik avatar Dec 16 '20 04:12 kshanik