Skip to content

Commit f3144c2

Browse files
committed
Include info about cot ignore_keys, update phrasing
1 parent c671add commit f3144c2

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

rfcs/0190-queue-change-task-run-priority.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Since we refactored queue internals it became possible to see what tasks are pending for a particular
88
worker pool / task queue.
99

10-
This RFC proposes new API method that would allow to change the priority of the existing task run / task group.
10+
This RFC proposes a new API method that would allow changing the priority of the existing task run / task group.
1111

1212
## Motivation
1313

@@ -30,19 +30,21 @@ Queue service will expose new methods:
3030
* `queue.changeTaskPriority(taskId, newPriority)`
3131
* `queue.changeTaskGroupPriority(taskGroupId, newPriority)`
3232

33-
New priority would be stored along the task definition for a given task or all tasks within the task group.
33+
New priority would replace the original one for a given task or all tasks within the task group.
3434

3535
The process to change single task will be as follows:
3636

37-
* new task priority will be stored in the database as `task.priority_override` column
38-
* if task was scheduled already, its priority in the `queue_pending_tasks` table will be updated
39-
* if the tasks run fails and new one is created, it will check if `task.priority_override` is set and use it instead of the original priority
37+
* new task priority will be stored in the database as `task.priority` (overriding existing value)
38+
* additionally, if task was scheduled already, its priority will be updated in the `queue_pending_tasks` table
4039

4140
The process to change the whole task group will be as follows:
4241

43-
* all tasks in the task group will be updated to store the new priority in the `task.priority_override` column
44-
* all currently scheduled tasks would be attempted to be updated in the `queue_pending_tasks` table
45-
* all unscheduled tasks and tasks that will be restarted will use the new priority
42+
* all tasks in the task group will be updated to store the new priority in the `task.priority` column
43+
* additionally, all currently scheduled tasks would be attempted to be updated in the `queue_pending_tasks` table
44+
45+
Tasks would only be updated if they are not resolved yet and before their deadlines.
46+
47+
> **Note**: To allow changing the priority of the task without breaking CoT validations, it would be necessary to add `"priority"` to the [`ignore_keys`](https://github.com/mozilla-releng/scriptworker/blob/454c4dd0bae7958140ea8d19adf3670e705ace09/src/scriptworker/cot/verify.py#L910)
4648
4749
### New scopes
4850

@@ -64,11 +66,6 @@ And for task group:
6466
Current order for picking up tasks is based on the task priority and insertion time (FIFO).
6567
This RFC proposes to change the priority only, and leave the insertion time as is.
6668

67-
### Other considerations
68-
69-
To ensure that Chain of Trust validation is not affected, we aim to keep the original task definition
70-
and store the new priority in a separate column.
71-
7269
## Implementation
7370

7471
_pending_

0 commit comments

Comments
 (0)