-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Move preparing of RuntimeContext to the async phase of workspace start #8989
Comments
Since the creation of a runtime context is one of the points of extension of SPI there is a lot of reasons why it may last a long time. I think it is very frustrating if this cause long execution of workspace starts API which is supposed to be asynchronous API. |
Update: |
Tried to move preparing of RuntimeContext to the async phase of workspace start and found out that there is an issue with cancelation. It is supposed that the workspace start may an interruptible process if infrastructure supports it (as docker, kubernetes, openshift support do).
As a temporary solution for plugin broking, it was decided to move it into runtime start phase as a quicker way to make a start of workspaces with plugins stable. Moving preparing of RuntimeContext to the async phase of workspace start should be investigated more, and the corresponding changes for SPI interfaces should be prepared for further discussion. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Description
Preparation of RuntimeContext may last a long period of time, like when Infrastructure needs to fetch images or send few requests during context preparing.

But it leads to issue with interruption of start workspace request. It happens because it is performing synchronously (see related code here). And browser interrupts requests if they last more than 30 seconds.
To fix this issue and make it possible to perform long living tasks while RuntimeContext preparing it is needed to move preparing of RuntimeContext to the async phase of workspace start. So context preparation should be a part of the WorkspaceRuntime.StartRuntimeTask#run method.
Also, it is required to set workspace status to STARTING when infrastructure is preparing context.
Reproduction Steps
OS and version:
Diagnostics:
The text was updated successfully, but these errors were encountered: