Restore live conformer jobs by name on restart, not the fossil 'conformer{i}' - #1015
Restore live conformer jobs by name on restart, not the fossil 'conformer{i}'#1015alongd wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1015 +/- ##
==========================================
+ Coverage 64.46% 64.61% +0.15%
==========================================
Files 119 119
Lines 39636 39639 +3
Branches 10276 10277 +1
==========================================
+ Hits 25550 25612 +62
+ Misses 11102 11036 -66
- Partials 2984 2991 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes ARC restart behavior so in-flight conformer jobs are reconnected correctly by restoring conformer job names in the same format used during normal execution, preventing the post-restart KeyError: '' crash in get_completed_incore_jobs.
Changes:
- Align
restore_running_jobs()conformer entries inrunning_jobswith the live'{job_type}_{i}'naming convention. - Update
get_i_from_job_name()docstring to reflect the accepted conformer job name formats. - Add a regression test covering restart + sweep for conformer job reconnection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| arc/scheduler.py | Restore conformer job names on restart using the live '{job_type}_{i}' format. |
| arc/scheduler_test.py | Add a regression test to ensure restart reconnection prevents the scheduling sweep crash. |
| arc/checks/common.py | Correct get_i_from_job_name docstring examples to match actual accepted formats. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…rmer{i}'
The contract: a running conformer job lives in self.running_jobs under the
same name the live path emits, '{job_type}_{i}' (e.g. 'conf_opt_0'). Every
consumer parses that format -- get_i_from_job_name strips the 'conf_opt'/
'conf_sp' prefix, and get_completed_incore_jobs routes on it into
job_dict[label]['conf_opt'][i].
How it broke: restore_running_jobs emitted the fossil 'conformer{i}' instead.
get_i_from_job_name returns None for it, so get_completed_incore_jobs fell into
its fallback branch, derived an empty job-type from the underscore-less name
('conformer0'.split('_')[:-1] == []), and died with KeyError: '' on the first
scheduling sweep -- crashing every ARC restart that had a live conformer job.
The fix emits '{job_type}_{i}' from the same expression the live path uses,
rather than a second hard-coded literal that must be kept in sync by hand. The
job_dict was already reconstructed correctly (conf_opt keyed by int index), so
the name was the only defect. Also corrects get_i_from_job_name's docstring,
which still advertised the retired 'conformer12' format.
The test drives a restart payload carrying a live conf_opt job through the real
restore_running_jobs + get_completed_incore_jobs path: red with KeyError: '' on
the unfixed code, green after.
82ee38a to
a692ce4
Compare
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
… by name on restart, not the fossil 'conformer{i}'
Motivation
Restarting a project that had conformer jobs in flight crashes with an unhelpful
KeyError: '':The cause is a naming mismatch between the two places
running_jobsis populated.The live path (
run_job) appendsf'{job_type}_{conformer}', e.g.conf_opt_0:The restart path (
restore_running_jobs) instead appends a fossilconformer{i}name that noconsumer of
running_jobsaccepts any more:get_i_from_job_nameonly recognises theCONFORMER_JOB_TYPESprefixes (conf_opt,conf_sp)and
tsg, so it returnsNoneforconformer0. The caller then falls through to thegeneric-job-name branch, which derives a job type by stripping the last
_-delimited field —'conformer0'.split('_')[:-1]is[], sojob_typebecomes''and the lookup raisesKeyError: ''.The effect is that a restart cannot reconnect to running conformer jobs. It is not specific to any
adapter or server; any project restarted while conformer jobs are queued or running hits it.
Changes
arc/scheduler.py—restore_running_jobsnow emits the same'{job_type}_{conformer}'namethe live path uses, so the restored entry is one
get_i_from_job_namecan parse.arc/checks/common.py— corrected theget_i_from_job_namedocstring, which cited'conformer12'as an example input. That form has not been accepted sinceCONFORMER_JOB_TYPESwas introduced, and the stale example is what makes the defect above read as intentional.
arc/scheduler_test.py— regression testtest_restore_running_jobs_conformer_reconnects.Verification
The test is red/green against this change, and the red reproduces the production error exactly:
arc/scheduler.pyreverted tomain:FAILED ... KeyError: ''atarc/scheduler.py:35081 passedarc/scheduler_test.pyis otherwise unaffected (44 passed alongside it locally; the remaininglocal errors are a pre-existing environment issue, present identically on
main).Context
Found while diagnosing a ~4 hour outage of a long-running rate campaign, where the orchestrator
died on restart and the traceback gave no indication that conformer jobs were the trigger.