Files
Rintaro Ishizaki 8d56a41a40 TaskScheduler: use the actual initial priority for handler baseline
`QueuedTask.resultTask` passed `self.priority` as `initialPriority` to
`withTaskPriorityChangedHandler`. If `elevatePriority(to:)` ran before
`resultTask`'s body started (e.g. the detached task hadn't been scheduled
yet), `self.priority` was already set to the elevated value, so the
polling baseline matched `Task.currentPriority` and `taskPriorityChanged`
never fired. The callback is what calls `poke()`, so the scheduler never
re-evaluated the elevated task and it could stall until an upstream 180s
timeout cancelled the chain.

Use the captured `priority` parameter instead. It matches the priority
that `Task.detached(priority: priority)` uses to launch the resultTask
and isn't subject to mutation by `elevatePriority`.

(cherry picked from commit 6cf8500d8b)
2026-06-01 10:49:47 -07:00
..
2025-10-31 14:11:11 -07:00
2025-12-02 12:27:27 +00:00