-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fixed race condition on monaco editor initialization #8563
Fixed race condition on monaco editor initialization #8563
Conversation
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 for the fix, there are build errors.
45cc46e
to
ff354d6
Compare
Thanks, I've fixed it. It seems there is still some issue with the dependencies but I don't think it's related to this PR. |
Indeed - it's because of |
@federicobozzini For the sake of verification, could you provide us with some pseudo stack trace illustrating the race condition? I'd like to understand the chain of events that lead to the issue, and I am having trouble finding it on my end. |
The stacktrace of the files creation on the frontend side is: Click to expand
This is not too easy to debug because as far as I understand most of this process is not started explicitly but by a chain of object creations and inizialitazions managed by The source of this error seems to come from the fact that the |
I think I get a general sense of the issue thanks to your explanation. I don't like this lock (deferred) to be exposed and waiting for some other component to release. It works, but I was looking for a different way to address the issue: Is it possible to move the code on which the |
ff354d6
to
e773f8d
Compare
@marechal-p I agree with you. I've changed the code to move the |
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.
LGTM.
@akosyakov you have more experience with the monaco integration, are we missing anything?
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.
Took a second look and had a few remarks.
9bb2437
to
b3ca800
Compare
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.
LGTM, thanks for the fix!
@marechal-p I've done some investigation and the problem with plugins doesn't seem to happen anymore. This PR should be now safe to merge. |
Please squash your commits, we can merge multi-commit PRs but the history has to stay clean from merge commits :) |
Signed-off-by: Federico Bozzini <[email protected]>
c44111e
to
ea8da32
Compare
@marechal-p It should now be ready. |
What it does
This PR fixes #8562. I think it was caused by a race condition in the Monaco Editor inizialization and this is one possible way to fix it.
How to test
To test try to run the browser version of Theia on windows, with a slow frontend contribution, and access Theia with a windows machine.
This fix prevents
MonacoTextModelService
to run untilMonacoEditorProvider
is properly initialized, preventing the issue from happening.Review checklist
Reminder for reviewers