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

IDE timeouts when trying to connect with the cloud #5627

Closed
2 tasks
sylwiabr opened this issue Feb 10, 2023 · 8 comments · Fixed by #5802
Closed
2 tasks

IDE timeouts when trying to connect with the cloud #5627

sylwiabr opened this issue Feb 10, 2023 · 8 comments · Fixed by #5802
Assignees
Labels
--bug Type: bug d-unknown Difficulty: unable to estimate difficulty p-medium Should be completed in the next few sprints s-research-needed Status: the task will require heavy research to complete

Comments

@sylwiabr
Copy link
Member

sylwiabr commented Feb 10, 2023

Discord username

No response

What type of issue is this?

Permanent – Ocurring repeatably

Is this issue blocking you from using Enso?

  • Yes, I can't use Enso because of this issue.

Is this a regression?

  • Yes, previous version of Enso did not have this issue.

What issue are you facing?

When opening Enso Cloud IDE timeouts on the first opening

Expected behaviour

Project is opened

How we can reproduce it?

  1. open enso cloud
  2. start and the open a project
  3. wait for project to initialize

Screenshots or screencasts

Enso Version

2023.1.1-nightly.2023.2.9

Browser or standalone distribution

Chrome

Browser Version or standalone distribution

Version 109.0.5414.119 (Official Build) (x86_64)

Operating System

MacOS

Operating System Version

No response

Hardware you are using

No response

@sylwiabr sylwiabr added --bug Type: bug triage labels Feb 10, 2023
@vitvakatu vitvakatu added the s-info-needed Status: more information needed from submitter label Feb 14, 2023
@vitvakatu
Copy link
Contributor

@sylwiabr can't reproduce the issues on my machine with Chrome Version 109.0.5414.119 (Official Build) (arm64).
We need additional info:

  1. What does IDE timeouts mean? What is a visible effect?
  2. Do you see any messages in UI or Dev Tools console after running showLogs() there?

@sylwiabr
Copy link
Member Author

sylwiabr commented Feb 15, 2023

The message is:

Image

And the console:

Image

@sylwiabr
Copy link
Member Author

It happens when I have a weaker internet connection

@vitvakatu vitvakatu added p-medium Should be completed in the next few sprints d-unknown Difficulty: unable to estimate difficulty s-research-needed Status: the task will require heavy research to complete and removed s-info-needed Status: more information needed from submitter triage labels Feb 15, 2023
@vitvakatu vitvakatu moved this from ❓New to 📤 Backlog in Issues Board Feb 15, 2023
@wdanilo
Copy link
Member

wdanilo commented Feb 19, 2023

@sylwiabr do you see any errors in console after expanding the log groups? Sometimes errors are hidden there

@farmaazon
Copy link
Contributor

farmaazon commented Mar 1, 2023

I was actually able to reproduce it and did an investigation.

Problem

The problem is twofold: first, the first connection to Language Server runs some initialization, and the session/initProtocolConnection response is returned only when it's finished.

Here is the log where the GUI connects and sends session/initProtocolConnection at 10:37:50. We got a response after 9.5 seconds - just in time, our timeout is set to 10!

engine-log-connected-10-37-50.txt

When the time since running the machine is small (I think < 1 minute), the machine seems to be still a bit loaded, extending the time of the initialization hitting our timeout. Here is the log when I opened GUI 30 seconds since the machine was reported as "running" (10:10:33) and got the timeout. The Language Server seem to be ready after 14 seconds.

engine-log-connected-10-10-33.txt

The second problem is that I was able to open the GUI even before Language Server was ready to listen for connections. Here, the GUI tried to connect at 10:43:37: a message about server start is printed 10 seconds later.

engine-log-connected-10-43-37.txt

Solutions

The easiest fix is just to increase timeouts. This will not fix the second problem, however; we would need also connection or initialization retries on the IDE side (still easy, but not trivial). It's not a satisfying solution for me, because this makes bad UX of two-staged initialization: user runs the machine, needs to wait for it, then we require their intervention (clicking "start" button) only to force them to wait again for Language Server initialization.

The proper solution in my opinion is:

  • make Language Server initialize after starting, not after first connection
  • make cloud allow opening GUI only after Language Server is both initialized and ready for receiving connections.
    The question is: what is doable for Design Partners?

@sylwiabr @PabloBuchu please share your thoughts, also @JaroslavTulach as we touch the Language Server initialization.

@enso-bot
Copy link

enso-bot bot commented Mar 1, 2023

Adam Obuchowicz reports a new STANDUP for today (2023-03-01):

Progress: Created an investigation report, discussed briefly with Paweł. It should be finished by 2023-03-06.

Next Day: Next day I will be working on the same task. increase the timeout for cloud environment, and see how it is hard to make simple retry reconnecting to the language server.

@farmaazon farmaazon moved this from 📤 Backlog to 🔧 Implementation in Issues Board Mar 1, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 2, 2023

Adam Obuchowicz reports a new STANDUP for today (2023-03-02):

Progress: Implemented retries - despite my fears it turned out to be a breeze. It should be finished by 2023-03-06.

Next Day: Next day I will be working on the same task. A little Cleanup and PR

@PabloBuchu
Copy link
Contributor

After brief discussion we agreed that cloud should also investigate the problem with to early reporting project to be ready to open.

Task for debugging and fixing https://github.com/enso-org/cloud-v2/issues/351

@farmaazon farmaazon moved this from 🔧 Implementation to 👁️ Code review in Issues Board Mar 6, 2023
@farmaazon farmaazon moved this from 👁️ Code review to 🌟 Q/A review in Issues Board Mar 7, 2023
@MichaelMauderer MichaelMauderer moved this from 🌟 Q/A review to 🟢 Accepted in Issues Board Mar 7, 2023
@mergify mergify bot closed this as completed in #5802 Mar 7, 2023
mergify bot pushed a commit that referenced this issue Mar 7, 2023
This mainly fixes #5627 in both scenarios: when the initProtocol method takes too long time and also when we run GUI before LS listens for new connections.

If the IDE initialization fails (e.g. due to above two reasons), it is retried 3 times, waiting some time.
@farmaazon farmaazon moved this from 🟢 Accepted to 🗄️ Archived in Issues Board Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug d-unknown Difficulty: unable to estimate difficulty p-medium Should be completed in the next few sprints s-research-needed Status: the task will require heavy research to complete
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants