This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
fix(vscode): add a timeout on the stream reading tasks #3995
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug in Windows where the
stdout
andstderr
streams of the CLI child process spawned by the extension would never close, making it hang indefinitely on startup. I've modified this logic to use a one second timeout to allow the closing event to be emitted after the child process has exited, after which the code will continue with the buffer content that has been flushed already. I've also included the logging code I've used to debug the issue, as I don't think it's particularly and issue if that's included in the debugging logs of the extension as it may help us figure out more information on this issue in the future.Test Plan
I've restarted the extension locally a few times until I could reproduce the issue (no stream events other than
data
being logged) and confirmed the extension was still starting up correctly in this case.