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

Move preparing of RuntimeContext to the async phase of workspace start #8989

Closed
sleshchenko opened this issue Mar 2, 2018 · 4 comments
Closed
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P2 Has a minor but important impact to the usage or development of the system. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.

Comments

@sleshchenko
Copy link
Member

sleshchenko commented Mar 2, 2018

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.
screenshot_20180302_125034

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:

@sleshchenko sleshchenko added status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Mar 2, 2018
@garagatyi
Copy link

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.
@sleshchenko I think we even might tag it as a bug.

@sleshchenko sleshchenko added kind/bug Outline of a bug - must adhere to the bug report template. and removed kind/task Internal things, technical debt, and to-do tasks to be performed. labels Mar 2, 2018
@sleshchenko
Copy link
Member Author

Update:
Also, it is required to set workspace status to STARTING when infrastructure is preparing context.

@sleshchenko sleshchenko added the severity/P2 Has a minor but important impact to the usage or development of the system. label May 8, 2018
@l0rd l0rd mentioned this issue Aug 22, 2018
24 tasks
@sleshchenko sleshchenko self-assigned this Aug 30, 2018
@sleshchenko sleshchenko added status/in-progress This issue has been taken by an engineer and is under active development. and removed status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. labels Aug 30, 2018
@sleshchenko
Copy link
Member Author

sleshchenko commented Sep 3, 2018

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).
There should be an ability to cancel context preparing as well when it will be moved to async part and long tasks can be submitted here.
SPI interface should be adapted to support it:

  • maybe contexts should be cached by WorkspaceRuntime instead of caching of runtimes;
  • infrastructure should return something like cancelable future or context should provide a method for preparing interruption;
  • Infrastructures implementations should provide their own context preparing cancelation, the same as it is done with runtime start interruption;

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.

@sleshchenko sleshchenko added status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. and removed status/in-progress This issue has been taken by an engineer and is under active development. labels Sep 3, 2018
@che-bot
Copy link
Contributor

che-bot commented Sep 7, 2019

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 7, 2019
@che-bot che-bot closed this as completed Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P2 Has a minor but important impact to the usage or development of the system. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.
Projects
None yet
Development

No branches or pull requests

4 participants