Commit 490edb3
committed
Clear placement reconcile flag via Drop guard
placement_reconcile_in_flight is set with a CAS at the top of
schedule_machine_placement_reconcile and was cleared by an explicit
store at the end of the spawned thread. If reconcile_machine_placements
ever panicked, the explicit store would not run and the flag would
latch forever, silently disabling every future reconcile for the
lifetime of the process.
Wrap the cleared-on-completion behaviour in a PlacementReconcileGuard
whose Drop impl clears the AtomicBool. Construct the guard on the
calling thread before thread::spawn so the flag also clears if the
spawn itself fails. The reconcile thread now drops the guard on
return or unwind, so any future panic in reconcile_machine_placements
no longer wedges the control plane.1 parent 2650b9b commit 490edb3
1 file changed
Lines changed: 25 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4689 | 4689 | | |
4690 | 4690 | | |
4691 | 4691 | | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
| 4704 | + | |
| 4705 | + | |
| 4706 | + | |
4692 | 4707 | | |
4693 | 4708 | | |
4694 | 4709 | | |
| |||
4708 | 4723 | | |
4709 | 4724 | | |
4710 | 4725 | | |
4711 | | - | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
4712 | 4734 | | |
4713 | | - | |
| 4735 | + | |
4714 | 4736 | | |
4715 | 4737 | | |
4716 | | - | |
| 4738 | + | |
4717 | 4739 | | |
4718 | 4740 | | |
4719 | 4741 | | |
4720 | 4742 | | |
4721 | | - | |
4722 | | - | |
4723 | | - | |
4724 | | - | |
4725 | 4743 | | |
4726 | 4744 | | |
4727 | 4745 | | |
| |||
0 commit comments