Skip to content

Commit 54c34bb

Browse files
committed
Propose queue changeTaskRunPriority
1 parent 7cf7165 commit 54c34bb

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ See [mechanics](mechanics.md) for more detail.
6868
| RFC#180 | [Github cancel previous tasks](rfcs/0180-Github-cancel-previous-tasks.md) |
6969
| RFC#182 | [Allow remote references to .taskcluster.yml files processed by Taskcluster-GitHub](rfcs/0182-taskcluster-yml-remote-references.md) |
7070
| RFC#189 | [Batch APIs for task definition, status and index path](rfcs/0189-batch-task-apis.md) |
71+
| RFC#190 | [Queue change task run priority](rfcs/0190-queue-change-task-run-priority.md) |
7172
| RFC#191 | [Worker Manager launch configurations](rfcs/0191-worker-manager-launch-configs.md) |
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# RFC 0190 - Queue change task run priority
2+
* Comments: [#0190](https://github.com/taskcluster/taskcluster-rfcs/pull/190)
3+
* Proposed by: @lotas
4+
5+
## Summary
6+
7+
Since we refactored queue internals it became possible to see what tasks are pending for a particular
8+
worker pool / task queue.
9+
10+
This RFC proposes new API method that would allow to change the priority of the existing task run.
11+
12+
## Motivation
13+
14+
There might be several use-cases when some worker pool has a lot of pending tasks and there is a need
15+
to move some more important task to the top of the waiting list, or also move down less important ones.
16+
17+
Instead of cancelling existing tasks we can instead choose to change task run priorities.
18+
19+
## Details
20+
21+
I propose we implement this on a task run level and not the task itself:
22+
23+
* tasks are supposed to be immutable
24+
* changing the priority makes more sense in the context of a specific run, not the whole task
25+
26+
Queue service will expose new method `queue.changeTaskRunPriority(taskId, runId, newPriority)`.
27+
28+
This will try to do the following:
29+
30+
* update `task.runs[runId]` in the database to reflect priority change (possibly extra field to keep the original)
31+
* update `priority` field in the `queue_pending_tasks` table
32+
33+
If any of this fails (for example task is being changed by some other process), this method will also fail.
34+
35+
This will also require introduction of the new scopes (anyOf):
36+
37+
* `queue:change-task-run-priority-in-queue:<taskQueueId>`
38+
* `queue:change-task-run-priority:<taskId>`
39+
40+
41+
Current order for picking up tasks is based on the task priority and insertion time (FIFO).
42+
This RFC proposes to change the priority only, and leave the insertion time as is.
43+
44+
45+
### Other considerations
46+
47+
Chain of Trust validation might be broken if we change too much of the task definition or run.
48+
We need to make sure we don't break it with this change.
49+
50+
51+
52+
53+
## Implementation
54+
55+
_pending_

rfcs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@
5656
| RFC#180 | [Github cancel previous tasks](0180-Github-cancel-previous-tasks.md) |
5757
| RFC#182 | [Allow remote references to .taskcluster.yml files processed by Taskcluster-GitHub](0182-taskcluster-yml-remote-references.md) |
5858
| RFC#189 | [Batch APIs for task definition, status and index path](0189-batch-task-apis.md) |
59+
| RFC#190 | [Queue change task run priority](0190-queue-change-task-run-priority.md) |
5960
| RFC#191 | [Worker Manager launch configurations](0191-worker-manager-launch-configs.md) |

0 commit comments

Comments
 (0)