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

fix #3797: [code] reconnect to the extension host #3840

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Apr 8, 2021

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

  • Start a workspace with VS Code.
  • Open devtools.
  • Check that search works and language smartness is there for js file.
  • In devtools's console: window.WebSocket.disconnectWorkspace to trigger reconnection, you need to wait a bit like 30 seconds
  • In devtools's network tab: check that new web sockets are established (not more than 2 for workspace origin!)
  • Check that search works and language smartness is there for js file.
  • Check in devtools's console that VS Code is not trying to reconnect forever.

@akosyakov akosyakov force-pushed the akosyakov/code-connection-to-server-3797 branch from 37cbb0e to 0b0bba5 Compare April 8, 2021 09:45
@akosyakov akosyakov force-pushed the akosyakov/code-connection-to-server-3797 branch from 0b0bba5 to 496dd71 Compare April 8, 2021 09:47
Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works as expected! 🚀

@akosyakov akosyakov merged commit e5cb492 into main Apr 8, 2021
@akosyakov akosyakov deleted the akosyakov/code-connection-to-server-3797 branch April 8, 2021 12:19
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

Successfully merging this pull request may close these issues.

[code] connection to the extension host suddenly breaks
2 participants