fix #3797: [code] reconnect to the extension host #3840
Merged
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.
What it does
The bug is that we pass net socket from the gitpod code server to the extension host process. And passing is done by serialising the socket in parent, then closing it for parent, passing to child process and deserialising. Before doing it though we should send a final seq of the handshake in the parent. And it used to work before we introduced gzipping of web sockets, it is not synchronous. So on reconnection it never came back. On initial connection there was a delay because of the child process should be spawn so it worked most of the time. Now we are always draining a socket before passing it to the child process.
Change in Gitpod Code: gitpod-io/openvscode-server@e3ac447
How to test
window.WebSocket.disconnectWorkspace
to trigger reconnection, you need to wait a bit like 30 seconds