Repository navigation
Commit 00cedfa
authored
fix(mothership): claim under the chat lock in the Stop-versus-recovery settlement test (#8728)
* fix(mothership): claim under the chat lock in the Stop-versus-recovery settlement test
The test raced Stop's settle against a recovering controller that claimed the run without
holding the chat lock. Recovery always locks the chat, proves its lease, then claims, and
settleStoppedRunWithoutController treats a run with no lock holder as unowned. So when the
claim committed before Stop read the run, which a loaded runner does, Stop read the new
controller token, found no lock holder and cancelled a run the test had just claimed: both
sides reported success. With the lock held, the same ordering leaves the run to its
controller.
The recovering controller now locks the chat and proves its lease before claiming, as
recover-stream does, and releases the lock when done. Both orderings are asserted
deterministically before the concurrent loop, which keeps its exactly-once assertion.
* fix(mothership): guard the recovering controller's lease instead of asserting it non-null
* fix(mothership): guard the run's controller token in the recovery helper and shrink the non-null baseline1 parent 48cbd4f commit 00cedfa
2 files changed
Lines changed: 45 additions & 8 deletions
File tree
- apps/sim/lib/mothership/async-runs
- scripts
Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 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 | + | |
568 | 610 | | |
569 | 611 | | |
570 | 612 | | |
571 | 613 | | |
572 | 614 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
| 615 | + | |
580 | 616 | | |
581 | 617 | | |
582 | 618 | | |
583 | 619 | | |
584 | 620 | | |
| 621 | + | |
585 | 622 | | |
586 | 623 | | |
587 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
1595 | | - | |
| 1595 | + | |
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
| |||
0 commit comments