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

IDE hangs when opening certain Git-managed projects on Windows #2141

Closed
kevinushey opened this issue Feb 6, 2018 · 3 comments · Fixed by #2148
Closed

IDE hangs when opening certain Git-managed projects on Windows #2141

kevinushey opened this issue Feb 6, 2018 · 3 comments · Fixed by #2148

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Feb 6, 2018

A number of users have reported issues with RStudio hanging on open with Windows. The general symptoms are:

  1. The IDE surface loads and initially appears to be responsive;
  2. However, attempting to execute any R code fails (the console never prints any output),
  3. Any other actions in the IDE silently appear to do nothing,
  4. Attempts to close the IDE also fail.

@andrie experienced this with one of his projects, and discovered that it seemed to be linked to the usage of Git -- the hang goes away once the .git folder is deleted.

Opening RStudio with Project Explorer, it seems as though RStudio is stuck in a loop querying the project with git status, while the asynchronous package completer tries to run as well. Note that the asynchronous package completer never finishes running, but git instances keep getting repeatedly launched.

screen shot 2018-02-05 at 4 31 54 pm

The error logs have this:

06 Feb 2018 00:32:37 [rsession-kevin] ERROR system error 5 (Access is denied) [path=C:/Users/kevin/Desktop/checkpoint/.git/index.lock]; OCCURRED AT: unsigned __int64 __cdecl rstudio::core::FilePath::size(void) const C:\jenkins\workspace\IDE\windows\src\cpp\core\FilePath.cpp:375; LOGGED FROM: unsigned __int64 __cdecl rstudio::core::FilePath::size(void) const C:\jenkins\workspace\IDE\windows\src\cpp\core\FilePath.cpp:375
06 Feb 2018 00:34:42 [rsession-kevin] ERROR system error 2 (The system cannot find the file specified) [path=C:/Users/kevin/Desktop/checkpoint/.git/index.lock]; OCCURRED AT: unsigned __int64 __cdecl rstudio::core::FilePath::size(void) const C:\jenkins\workspace\IDE\windows\src\cpp\core\FilePath.cpp:375; LOGGED FROM: unsigned __int64 __cdecl rstudio::core::FilePath::size(void) const C:\jenkins\workspace\IDE\windows\src\cpp\core\FilePath.cpp:375

Attempting to manually execute git status does succeed when launched from the command line, so it's not immediately obvious what the issue might be (unless it's the collision between these child processes that is somehow the culprit).

@kevinushey kevinushey added this to the v1.2 milestone Feb 6, 2018
@kevinushey
Copy link
Contributor Author

kevinushey commented Feb 6, 2018

It looks like this issue can occur if the .git folder is no longer marked as a Hidden folder by the Windows filesystem. In that case, RStudio seems to get stuck in a loop where:

  1. RStudio attempts to invoke git status,
  2. This causes an index.lock file to be created,
  3. The file monitor sees this, and opens a connection to the file,
  4. The duplicate attempts to open the file interfere, and this seems to cause a kind of deadlock.

I can reproduce this by removing the Hidden attribute on any Git-managed project. I'm guessing this can happen when directories are transferred using mechanisms that don't preserve these Windows-specific filesystem attributes.

We should avoid relying on the system hidden attribute and intentionally screen the .git (and .Rproj.user) folders out from the file indexer.

@andrie
Copy link
Member

andrie commented Feb 6, 2018

This makes sense, and thank you for looking into the issue. In my case, the project was shared by Microsoft OneDrive, so this would have been the cause of the change in hidden status of the .git folder.

@andrie
Copy link
Member

andrie commented Feb 6, 2018

I can also confim that if I manually set the properties of the .git folder to hidden, the problem goes away.

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

Successfully merging a pull request may close this issue.

4 participants