Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getVolumes hangs when drive is no longer available #155

Closed
see24 opened this issue Feb 18, 2021 · 7 comments
Closed

getVolumes hangs when drive is no longer available #155

see24 opened this issue Feb 18, 2021 · 7 comments

Comments

@see24
Copy link

see24 commented Feb 18, 2021

This is a very specific issue that might not come up for many people but it was really annoying for me so thought I would put it out there.

getVolumes was working fine in my app and then the app stopped working completely which I eventually traced to getVolumes()() hanging for a long time. I eventually figured out that this was happening because I had disconnected from my VPN to connect to my work network. This meant that network drives that were mapped when I logged in to the VPN and still to show up in the file explorer(but they never load and hang in the windows explorer too) were being looked for by getVolumes and that is what made it hang.

I added R.utils::withTimeout around the getVolumes call so that I don't do this to myself again, but wondering if it would make sense to add a timeout with in getVolumes?

@vnijs
Copy link
Collaborator

vnijs commented Apr 11, 2021

Thanks for reporting @see24. I made a change to the commands on Windows that scan for drives (see link below). My hope is that this will skip drives that do not respond within 3 seconds and then move on to other drives.

I don't have any network drives on Windows to fully test this out so could you try it and let me know?

To install the development version of shinyFiles please use the command below:

remotes::install_github("thomasp85/shinyFiles", upgrade="never")

f875ad1#diff-03e4b0fc41a86a656bef22b0ca136edf24dc52190ba342aafd7eca8ede337e30R82-R86

@see24
Copy link
Author

see24 commented Apr 12, 2021

While connected to the VPN I got this warning message:
"Warning in system(paste(wmic, "/FAILFAST:3000 logicaldisk get Caption"), :
running command 'C:\WINDOWS\System32\Wbem\WMIC.exe /FAILFAST:3000 logicaldisk get Caption' had status 44003"
But it all worked fine as before.
When I disconnected from the VPN and tried again the app loaded okay but when I open the file selector it is blank and I cannot navigate to any files. There is no error message so it is not clear what has gone wrong. Then after 3 minutes the folder showed up and I was able to select a file and it all worked.

@vnijs
Copy link
Collaborator

vnijs commented Apr 17, 2021

Thanks for testing this out! I made a change that will (1) hopefully avoid the warning being printed and (2) fail faster if VPN is not on. See commit linked below. Can you try again? Also, feel free to make edits to R/aaa.R and report if you find settings for /FAILFAST that work best. I think this is the best path to go because it should still return other drives even if one network drive is not accessible. Unfortunately I don't have any way to test this so I have to rely on your input. Thanks!

3ed2746

@vnijs
Copy link
Collaborator

vnijs commented Apr 17, 2021

Minor update. Use the code below to install the latest version.

remotes::install_github("thomasp85/shinyFiles", upgrade="never")

https://github.com/thomasp85/shinyFiles/blob/master/R/aaa.R#L82-L86

@vnijs
Copy link
Collaborator

vnijs commented May 29, 2021

@see24 Can you try this out? Use the code below to install the latest version.

remotes::install_github("thomasp85/shinyFiles", upgrade="never")

https://github.com/thomasp85/shinyFiles/blob/master/R/aaa.R#L82-L86

@see24
Copy link
Author

see24 commented Sep 20, 2021

Works well now! The first time connecting after disconnecting from VPN it takes a little while for the file selector to load but works well and it is not too long.
Thanks for fixing this and sorry I took so long to test it!

@vnijs
Copy link
Collaborator

vnijs commented Sep 23, 2021

Thanks @see24 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants