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

vdk-jupyter: introduce a polling mechanism in the backend that would execute tasks in the background and track their status #2806

Closed
yonitoo opened this issue Oct 18, 2023 · 0 comments
Assignees
Labels

Comments

@yonitoo
Copy link
Contributor

yonitoo commented Oct 18, 2023

What is the feature request? What problem does it solve?
The VDK JupyterLab extension encounters the following problem: it receives a 504 Gateway Time-out error while waiting for a long process to conclude. This error likely comes from an intermediate proxy or the server configuration due to prolonged inactivity.

Suggested solution
The idea is to introduce a new class TaskRunner that would provide a polling mechanism. It would have an interface similar to this:

  • start_task(id, task_handler) -> T/F (or something else); task_handler is a lambda function that would execute what the post methods of the current derived APIHandler classes do
  • get_status(id) -> complex output dict/structure/class that would contain at least the following keys: "status", "message" and "error". It would be used to check the status of the currently running task and if the task has finished - proper message and error.

We would check the status of the ongoing task every x seconds or following some other pattern, having some threshold number of status checks. After the last one, if the task is still ongoing, we will return some kind of error to the user.

Additional context
It is a follow-up of the solution provided in #2789.

@yonitoo yonitoo added enhancement New feature or request area/plugin/vdk-jupyterlab-extension story Task for an Epic labels Oct 18, 2023
@yonitoo yonitoo self-assigned this Oct 18, 2023
@yonitoo yonitoo changed the title vdk-jupyter: introduce a polling mechanism in the backend that would execute jobs in the background and track their status vdk-jupyter: introduce a polling mechanism in the backend that would execute tasks in the background and track their status Oct 19, 2023
yonitoo added a commit that referenced this issue Nov 16, 2023
…ks in the background and tracks their status (#2869)

What: Introduce Task Runner, a polling mechanism that runs tasks in the
background and tracks their status.
Implements
[#2806](#2806) and
[#2807](#2807).

Why: Address the problem described in
[#2789](#2789).

Testing Done: CI/CD is passing. Introduced relevant tests

Signed-off-by: Yoan Salambashev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants