-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fixes #90125 - Add a task instancePolicy to task runOptions #117129
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
Conversation
creating a new instance of a task, once the instanceLimit has been reached.
|
Thanks for the updated PR! I will try to take a look in March. |
|
I am interested in this feature, as the current task system require more manual clicking (to restart) that just using the terminal. |
alexr00
left a comment
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.
Thanks for the PR! In May of 2020 I made some changes to task instance to fix some related bugs, but it looks like this updated PR doesn't take those changes into account.
|
@alexr00 ping 🙂 |
|
Hello, I'm sorry if I'm being annoying, but this has been waiting to be reviewed for over the last 4 months with completely no progress. This feature seems really quite useful, so I'd appreciate someone at least looking at this |
|
@alexr00 Is this PR on the right path? If someone finds time to rebase it, will it be LGTM-ed? |
|
Any updates to this ticket? |
|
There are some conflicts - I will try to make time to review it if those get fixed |
Imran-imtiaz48
left a comment
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.
The code revisions refine the logic for selecting instances to terminate by directly comparing task IDs instead of common prefixes. The updated code simplifies the filtering process to match tasks based on their exact IDs rather than a shared prefix, which enhances accuracy in identifying the correct instance. This change eliminates potential mismatches caused by common ID prefixes and ensures that users are prompted to select the exact instance they intend to terminate, improving both precision and user experience.
| } else { | ||
| this._taskSystem?.revealTask(executeResult.task); | ||
| } | ||
| this.handleInstancePolicy(executeResult.task, executeResult.task.runOptions!.instancePolicy); |
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.
we are now missing this check for task visibility this._taskSystem?.isTaskVisible(executeResult.task). If a task is not visible, I don't think it'll be revealed with this change?
|
Is this still relevant? |
|
IMO #90125 is still relevant: avoid having to manually terminate tasks... or the workaround to terminate ALL tasks This PR seems to be the most recent one referencing the issue. |
|
Also here from #90125 Would be really nice for any task that doesn't have it's own filewatcher built in |
|
The conflicts are pretty confusing, @alpalla , would you consider creating a new branch based on |
…ish/tweak. Co-authored-by: alpalla <[email protected]>
…ish/tweak. Co-authored-by: alpalla <[email protected]>
Bring changes from #117129 to new branch to avoid conflicts. Also polish/tweak. Co-authored-by: alpalla <[email protected]>
@meganrogge sorry I didn't see your comment, thank you so much for taking care of this 🙏🏻 |
Fixes #90125.
This pull request replaces the old one I opened (#90914) for the same issue almost a year ago.
Summary
Added an
instancePolicytorunOptions. TheinstancePolicyis applied when creating a new instance of a task once theinstanceLimithas been reached.There are five options for
instancePolicy:terminateNewest: the newest instance is terminatedterminateOldest: the oldest instance is terminatedprompt: the QuickPick is shown and the user picks an instance to restartwarn: do nothing (do not terminate an existing instance or create a new one) and show a warning that indicates that theinstanceLimithas been reachedsilent: do nothingpromptis the default option.Testing changes
Create a
tasks.jsonand set theinstancLimitandinstancePolicyproperties. Here is an example configuration:{ "version": "2.0.0", "tasks": [ { "label": "echo", "type": "shell", "command": "date && sleep 300", "runOptions": { "instanceLimit": 2, "instancePolicy": "terminateOldest" } } ] }Ensure that once the
instanceLimitis reached, the choseninstancePolicybehaves as intended.@alexr00 to get things working I had to revert some changes you made for Fix unlimited instances of recent tasks bug.
In particular here and here.
I just want to be sure there are no regressions.