pallet-scheduler: Put back postponed tasks into the agenda#7790
pallet-scheduler: Put back postponed tasks into the agenda#7790
Conversation
Right now `pallet-scheduler` is not putting back postponed tasks into the agenda when the early weight check is failing. This pull request ensures that these taks are put back into the agenda and are not just "lost".
|
/cmd prdoc --audience runtime-dev --bump patch |
|
Command "prdoc --audience runtime-dev --bump patch" has failed ❌! See logs here |
|
/cmd prdoc --audience runtime_dev --bump patch |
…kadot-sdk into bkchr-scheduler-postponed
| ); | ||
| if !weight.can_consume(base_weight) { | ||
| postponed += 1; | ||
| agenda[agenda_index as usize] = Some(task); |
There was a problem hiding this comment.
I see, so this is what was missing from before: the task would have been taken above, and not put back in the agenda.
gui1117
left a comment
There was a problem hiding this comment.
The change looks good, but I don't understand another part of the code,
if service_task fails, we put back the task into agenda, even when error is Unavailable.
polkadot-sdk/substrate/frame/scheduler/src/lib.rs
Lines 1254 to 1267 in 5439b5f
But in service_task we do return some task with error Unavailable when:
- getting the preimage failed
- the execution fails because it is overweight and it is the first task
If any of these case happen, the task will stay forever on the agenda of the block and brick the agenda no?
It feels like it should be dropped instead.
Co-authored-by: Guillaume Thiolliere <[email protected]>
Co-authored-by: Alexandre R. Baldé <[email protected]>
Co-authored-by: Alexandre R. Baldé <[email protected]>
I have to admit, every time I take a close look at the scheduler, I find something weird :) However, what you said should be fine in most of the cases.
|
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
* master: pallet-scheduler: Put back postponed tasks into the agenda (#7790) ci: update credentials for command-backport (#7798) [XCM] add generic location to account converter that also works with external ecosystems (#7313) [AHM] Make more stuff public (#7802) Support adding extra request-response protocols to the node (#7708) notifications/tests: Fix tests to avoid overflow on adding duration to instant (#7793) pallet revive: rpc build script should not panic (#7786) pallet-bridge-relayers - migrate benchmarks to v2 (#7531)
Right now
pallet-scheduleris not putting back postponed tasks into the agenda when the early weight check is failing. This pull request ensures that these tasks are put back into the agenda and are not just "lost".