fix(runtime): preserve rebalancer state on shutdown

Merged
RE
2mo ago
+110-93

Problem

During graceful silo shutdown, the activation rebalancer monitor requested migration of its worker but did not wait for the asynchronous migration to finish. Ordinary grain deactivation could therefore overtake the handoff, causing the worker to reactivate without its serialized state and leaving tests dependent on stale monitor reports and timing.

Solution

Move the rebalancer handoff to a lifecycle stage immediately before ordinary grain deactivation and await the worker's deactivation/migration completion. Update the regression test to synchronize initial placement and rebalancing cycles explicitly, verify the dead host is no longer used, and compare the preserved report state after migration. Placement hints are now cleared after test activation creation so they cannot leak into later calls.

Rationale

The migration manager and grain directory are still available at this stage, while the catalog has not yet begun bulk deactivation. Awaiting the handoff makes graceful shutdown ordering deterministic and preserves the worker's migration state instead of relying on retries or longer delays.

Fixes #10570

Microsoft Reviewers: Open in CodeFlow