-
Notifications
You must be signed in to change notification settings - Fork 21
Propose queue changeTaskRunPriority #190
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
84fb9cb
a80bc75
24e74fa
4da263a
34535c4
276a152
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # RFC 0190 - Queue change task run priority | ||
| * Comments: [#0190](https://github.com/taskcluster/taskcluster-rfcs/pull/190) | ||
| * Proposed by: @lotas | ||
|
|
||
| ## Summary | ||
|
|
||
| Since we refactored queue internals it became possible to see what tasks are pending for a particular | ||
| worker pool / task queue. | ||
|
|
||
| This RFC proposes new API method that would allow to change the priority of the existing task run. | ||
|
|
||
| ## Motivation | ||
|
|
||
| There might be several use-cases when some worker pool has a lot of pending tasks and there is a need | ||
| to move some more important task to the top of the waiting list, or also move down less important ones. | ||
lotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Instead of cancelling existing tasks we can instead choose to change task run priorities. | ||
|
|
||
| ## Details | ||
|
|
||
| I propose we implement this on a task run level and not the task itself: | ||
|
|
||
| * tasks are supposed to be immutable | ||
| * changing the priority makes more sense in the context of a specific run, not the whole task | ||
lotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Queue service will expose new method `queue.changeTaskRunPriority(taskId, runId, newPriority)`. | ||
lotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This will try to do the following: | ||
|
|
||
| * update `task.runs[runId]` in the database to reflect priority change (possibly extra field to keep the original) | ||
| * update `priority` field in the `queue_pending_tasks` table | ||
|
|
||
| If any of this fails (for example task is being changed by some other process), this method will also fail. | ||
|
|
||
| This will also require introduction of the new scopes (anyOf): | ||
|
|
||
| * `queue:change-task-run-priority-in-queue:<taskQueueId>` | ||
| * `queue:change-task-run-priority:<taskId>` | ||
|
||
|
|
||
|
|
||
| Current order for picking up tasks is based on the task priority and insertion time (FIFO). | ||
| This RFC proposes to change the priority only, and leave the insertion time as is. | ||
|
|
||
|
|
||
| ### Other considerations | ||
|
|
||
| Chain of Trust validation might be broken if we change too much of the task definition or run. | ||
lotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| We need to make sure we don't break it with this change. | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ## Implementation | ||
|
|
||
| _pending_ | ||
Uh oh!
There was an error while loading. Please reload this page.