-
Notifications
You must be signed in to change notification settings - Fork 18
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
77: BaseGLSPClient should handle reconnect #197
Conversation
7163806
to
7180aeb
Compare
Should be merged after #196 |
"@theia/filesystem": "^1.39.0", | ||
"@theia/messages": "^1.39.0", | ||
"@theia/monaco": "^1.39.0" | ||
"@theia/core": "^1.45.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breaking change was introduced with 1.44.x so this should be "^1.44.0".
I will update this in #196 accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I need 1.45, because this PR is integrating the changes from eclipse-theia/theia#13082. Unless I'm mistaken, these changes are only available in >= 1.45
Edit: it should even be 1.45.1, because 1.45 contains a memory leak in the reconnect feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @CamilleLetavernier!
Code looks good to me, and I tested several user scenarios with the interrupt command and it works great! 🎉
7180aeb
to
dc0d301
Compare
@ndoschek Thanks for reviewing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the change looks good to me and for the most cases disconnect/reconnect seems to work as expected.
However, there seems to be an issue if the server sends actions/updates while the fronted is disconnected. All actions send from the server in this period are lost.
To test this I modified the example server to send a status action with an incremented counter every second. If I disconnect the frontend for 10 seconds you can see that 10 status updates are lost:
This is especially critical if the client has a promise that his waiting for a server response (e.g. request actions or progress updates). E.g. if you disconnect during the initial model loading nothing happens after reconnect (i.e. the diagram stays empty).
AFAIK Theia has buffering in place to cache messages that are sent via the service socket while disconnected. So I think the issue here is somewhere in our GLSP frontend code.
Nevertheless we could still merge this and work on the mentioned issues in a follow-up PR.
Thanks for the review and feedback! Indeed, I was focusing on more "local" use cases, where e.g. the computer goes to sleep for a prolonged period of time (which is a very common issue in local development or electron scenarios). In such cases, we are unlikely to have any pending request. However, for real deployment, network failures are a totally realistic scenario we should handle.
That would be great! I think this PR already handles a number of use cases, and we can further improve on it in follow-ups. |
dc0d301
to
13dbac5
Compare
I've removed the test command commit from the PR. Edit: we decided to keep the test command in the Workflow Example, so I've restored it again :) |
13dbac5
to
dc0d301
Compare
We probably don't want to actually push this command, so I added it as a separate commit. We might want to revert it before actually merging anything.Note: once the update to Theia 1.45 is in, the only required change is a Theia config option in the application, to actually enable the behavior. I don't think any change in required in GLSP itself. Typically, we want a relatively short timeout for Browser Application (especially if they are deployed to the cloud), to avoid large memory leaks, and an infinite timeout (-1) for Electron applications, as we only ever expect a single connection. I chose a 24-hours timeout, which is pretty long, because this is an example application that is typically deployed locally for testing; so we're closer to the Electron scenario (single user local deployment) than a regular web-app.
Part of eclipse-glsp/glsp#77