Commit 7aab9b9
committed
fix(run-engine): re-arm the park deadline when a parked run is not due yet
The external-deployment park deadline is armed once, when the run is first
parked, from max(now, delayUntil) + deadline. Debounce can push delayUntil out
afterwards: rescheduleDelayedRun reschedules enqueueDelayedRun:<id>, and the
redis-worker reschedule is an update-only ZADD, so expireParkedExternalDeploymentRun:<id>
is never re-armed.
Repeat triggers on one debounce key therefore walk delayUntil past a deadline
that no longer moves, and the run is expired with EXTERNAL_DEPLOYMENT_NOT_FOUND
before it was ever due to start. Reproduced against a local instance: a run due
at 14:01:37 was expired at 13:57:02, blaming a missing deployment.
The expiry job already loads delayUntil, so it now re-arms from the current
value and returns instead of expiring a run that is not due. Putting the guard
here rather than in the debounce path covers every caller that moves delayUntil,
and it stays bounded by the debounce max-duration contract.1 parent 0110494 commit 7aab9b9
2 files changed
Lines changed: 76 additions & 0 deletions
File tree
- internal-packages/run-engine/src/engine
- systems
- tests
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
473 | 489 | | |
474 | 490 | | |
475 | 491 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
569 | 629 | | |
570 | 630 | | |
571 | 631 | | |
| |||
0 commit comments