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

Editor appears to be hanging loading file after re-registering FileSystemProvider #61182

Closed
IlyaBiryukov opened this issue Oct 17, 2018 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues remote Remote system operations issues

Comments

@IlyaBiryukov
Copy link

Issue Type: Bug

VS Code version: Code 1.28.1 (3368db6, 2018-10-11T18:13:53.910Z)
OS version: Windows_NT x64 10.0.17763

When VSCode opens a document with custom scheme, if at this point the file system provider registered for this scheme is disposed, VSCode editor just keeps loading the document forever, even if a new file system provider is registered for the same scheme.

We have to dispose of the file system provider and register a new one because we want to change read-only status of the provider. The only way to do that is to do dispose-re-register for the same scheme.

Ideally, if VSCode allowed to change read-only status of the provider on the fly, without the need for disposing-re-registering, this should help us avoid the issue.

Or, alternatively, If VSCode cannot load the document because the file system provider got disposed in the middle of reading, VSCode should not try to load the document anymore and should close its editor window.

When this issue happens I see a TypeError exception is thrown:

TypeError: Cannot read property 'readFile' of undefined
    at e.$readFile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:492:286)
    at t._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:640:888)
    at t._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:640:554)
    at t._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:639:126)
    at t._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:638:59)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:635:926
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:98:138
    at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:99:496)
    at a (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:213)
    at Socket.n._socketDataListener (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:154:432)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
@vscodebot
Copy link

vscodebot bot commented Oct 17, 2018

@IlyaBiryukov
Copy link
Author

It seems this issue happens when in src\vs\workbench\services\files\electron-browser\remoteFileService.ts in _readFile() the file system provider is disposed after stat() succeeds and before read() commences. In this case the errors emitted from Readable created by createReadableOfProvider are not properly handled by the downstream code.

@isidorn
Copy link
Contributor

isidorn commented Oct 18, 2018

@IlyaBiryukov thanks for nice investigation.
Assigning to @jrieken since it seems to me that the readFile should fail more gracefully
Feel free to bounce back to me..

@isidorn isidorn assigned jrieken and unassigned isidorn Oct 18, 2018
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug remote Remote system operations issues file-io File I/O labels Oct 18, 2018
@jrieken jrieken assigned isidorn and unassigned jrieken Oct 18, 2018
jrieken added a commit that referenced this issue Oct 18, 2018
@jrieken
Copy link
Member

jrieken commented Oct 18, 2018

@isidorn I have pushed a change that makes sure the error doesn't get stuck in streams and that the error is somewhat more meaningful. However, for the full deal story we should cancel file loads when its provider is gone and/or close editors that don't have a provider anymore

@isidorn isidorn added this to the Backlog milestone Mar 14, 2019
@isidorn isidorn added feature-request Request for new features or functionality file-explorer Explorer widget issues and removed bug Issue identified by VS Code Team member as probable bug labels Mar 14, 2019
@bpasero bpasero removed the file-io File I/O label Oct 10, 2019
@isidorn isidorn modified the milestones: Backlog, Backlog Candidates Oct 23, 2019
@vscodebot
Copy link

vscodebot bot commented Jan 15, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot
Copy link

vscodebot bot commented Mar 6, 2020

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

@vscodebot
Copy link

vscodebot bot commented Mar 16, 2020

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Mar 16, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues remote Remote system operations issues
Projects
None yet
Development

No branches or pull requests

4 participants