• graphlemon authored
     
    Browse Code »
  • …c231-main-checkout-drift
    graphlemon authored
     
    Browse Code »
  • _launch_candidate() spawns a real `python -m src.backend_server` process
    (`revived`) to re-verify the previous version during a post-cutover
    rollback. On the success path it's correctly left running -- it IS the new
    Live. But on every failure path (never bound live_port, failed
    re-verification, git revert conflict) nothing ever terminated it -- found
    via 31 accumulated orphaned processes on this machine, one per failed
    rollback_path_b call across many real test runs this session.
    
    This is also the likely cause of RollbackPathBFailureTest's own reported
    non-determinism (three independent real Validator sessions saw it fail,
    never reproduced manually): a leaked process from an earlier failed run
    can still be squatting on the port a later run's _find_free_port() picks,
    producing a false "alive" health-check reading.
    
    Fix: call deploy_cutover._stop_process(revived.pid) in both failure
    branches before raising, mirroring the pattern cutover() already uses for
    its own stop_timeout-bounded process teardown. Also fixes
    RollbackPathBHappyPathTest's own matching leak (it re-appended bad_live.pid
    a second time instead of tracking the actual revived process, a
    copy-paste bug, not real cleanup) by capturing the real pid via a thin
    _launch_candidate wrapper.
    
    31 pre-existing orphaned processes killed by hand; verified 5 repeated
    test runs after the fix leak zero new ones.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse Code »