Skip to main content

apply_pending

Function apply_pending 

Source
pub(super) fn apply_pending(
    regs: &[&(dyn Migration + Sync)],
    home: &Path,
    shared_store_path: &Path,
    data_dir: &Path,
    progress: Option<&ApplyProgress<'_>>,
) -> Result<ApplyOutcome, String>
Expand description

The locked migration batch — the ONE apply path, used by the daemon (run_pending_migrations) and by agentmux-srv migrate. Generic over the registry so the concurrency contract can be tested with a fake migration.

Order matters and is the point of Phase 3: the cross-process lock is taken FIRST, before the stores are even opened, so that check → run → mark is one critical section and a second runner blocks on the lock (30 min) rather than tripping Store::open*’s 5 s busy timeout against a migrating peer.