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

Fix #9697: tasks#taskExecutions not return running tasks after refresh #10330

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

EstherPerelman
Copy link
Contributor

@EstherPerelman EstherPerelman commented Oct 27, 2021

Signed-off-by: Esther Perelman [email protected]

The issue: On TasksExtImpl constructor this.fetchTaskExecutions() was supposed to initial executions map with the running tasks so that when plugins ask for tasks#taskExecutions the executions map is returned with the running tasks full with the fetched ones,
But I found that the fetchTaskExecutions function never executes - because at this time (inside the constructor) the RPC not completely loading the proxy (setting a timeout of several seconds to the execution of fetchTaskExecutions - made it work).

The solution: So I wrote this PR in which I removed the call to fetchTaskExecutions from the TasksExtImpl constructor but added initTaskLoaded inside TasksExtImpl constructor.

What it does

Fix #9697

How to test (you can use the same steps to reproduce the issue on master)

  1. upload the next plugin (inside the zip) to theia:
    task-sample.zip
  2. create a sleep task, I used this:
    { "label": "sleep", "type": "shell", "command": "ping -n 88 127.0.0.1 >nul" }
  3. run the sleep task
  4. refresh the browser
  5. ensure the task is still running by selecting Terminal -> Show Running Tasks
  6. ctrl+shift+p -> Show Running Tasks **Length**
  7. A message of running:1 need to be shown, Otherwise (the buggy result): running:0

Review checklist

Reminder for reviewers

…ks after refresh

Signed-off-by: Esther Perelman <[email protected]>
@vince-fugnitto vince-fugnitto added tasks issues related to the task system plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility labels Oct 27, 2021
Copy link
Contributor

@tsmaeder tsmaeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, as far as I can tell. However, I can't really test the PR, because for me, when I run a "sleep task" (timeout /T 500 on Window), I never see the task when I invoke "Show running tasks...".

@EstherPerelman
Copy link
Contributor Author

The code looks good, as far as I can tell. However, I can't really test the PR, because for me, when I run a "sleep task" (timeout /T 500 on Window), I never see the task when I invoke "Show running tasks...".

I'm also on Windows, The task in the How to test doesn't work for you?

@tsmaeder
Copy link
Contributor

@EstherPerelman

ensure the task is still running by selecting Terminal -> Show Running Tasks

That never shows the "sleep" task in master, even in master. What am I missing?

@msujew
Copy link
Member

msujew commented Oct 29, 2021

That never shows the "sleep" task in master, even in master. What am I missing?

@tsmaeder Running timeout /T 500 in Theia automatically ends the task for some reason (as if pressing a key):

image

Show running tasks also doesn't show anything for me in that case. However, running ping -n 88 127.0.0.1 >nul works fine for me:

image

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, and it seems to work well on both Windows and Ubuntu.

@tsmaeder Do you still plan on looking into this? I'll hold back my approval for now.

@tsmaeder
Copy link
Contributor

@msujew code looks good to me and I think on test run is enough for the size of the change.

Running timeout /T 500 in Theia automatically ends the task for some reason (as if pressing a key):

While the task may be finished, the "cmd" process is still present in the Windows task manager. But I can't imagine this being related to the PR.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, then I'll be approving this, thanks @EstherPerelman 👍

Copy link
Contributor

@alvsan09 alvsan09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified that this PR in Linux and it works as expected 👍

The code looks good to me as well !
Thanks @EstherPerelman !

@alvsan09 alvsan09 merged commit e5e6f92 into eclipse-theia:master Oct 29, 2021
@vince-fugnitto vince-fugnitto added this to the 1.20.0 milestone Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system tasks issues related to the task system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tasks#taskExecutions is empty after refreshing webpage even though there're tasks running
5 participants