Commit c92fbf1
fix(plans): honor abort during parallel wave slot-wait
In executeStepsInWaves, when all maxConcurrent slots were full of slow
steps, a cancelled plan kept spinning the slot-wait poll until a step
finished — the wave-top abort check can't fire while the inner scheduling
loop holds control. Cancellation was still eventually honored (next wave
top), but delayed, and the remaining ready steps were scheduled anyway.
The slot-wait and the step-scheduling loop now re-check signal.aborted and
break. Crucially they break rather than throw mid-loop: throwing would
orphan the already-pushed stepPromises (Promise.all is what attaches their
rejection handlers), reintroducing the unhandled-rejection class just
fixed in JobQueueService. Scheduled steps are still awaited via
Promise.all, then the abort is surfaced as 'cancelled'.
Regression test: with maxConcurrent=1 and stepA gated, aborting while
stepB waits for the slot leaves stepB unscheduled and resolves the plan
'cancelled' (not failed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 66840f7 commit c92fbf1
3 files changed
Lines changed: 88 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
939 | 1002 | | |
940 | 1003 | | |
941 | 1004 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
467 | 476 | | |
| 477 | + | |
468 | 478 | | |
469 | 479 | | |
| 480 | + | |
470 | 481 | | |
471 | 482 | | |
472 | 483 | | |
| |||
480 | 491 | | |
481 | 492 | | |
482 | 493 | | |
483 | | - | |
| 494 | + | |
| 495 | + | |
484 | 496 | | |
485 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
486 | 505 | | |
487 | 506 | | |
488 | 507 | | |
| |||
0 commit comments