Ride out a CRAB status response that cannot be read - #18
Merged
kandrosov merged 1 commit intoAug 28, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What the message actually means
The 4763 errors are not the new-task case. law already handles that: when the per-job JSON is
missing it accepts the response if the CRAB server status is one of
HOLDING/NEW/QUEUED on command SUBMITorSUBMITTED, and marks the jobs pending. Here it reportedbut got 'None'— the value isliterally
None, meaning law could not find theStatus on the CRAB serverline at all. Theresponse was unreadable, not merely early.
It is transient: both of the running tasks parse cleanly now.
Why one bad response costs so much
Two amplifiers in law turn a single hiccup into what you saw:
query_groupmaps one group failure onto every job of the task, hence 4763 identical lines;continue(law/workflow/remote.py:1157) — the rest of thatiteration is abandoned: no status line, no resubmission of the retry jobs, and the other CRAB
task's perfectly good data thrown away with it.
poll_failsconsecutive occurrences kill theworkflow outright.
So with two tasks in flight, one flaky status response wastes the whole poll.
The change
A
DSProdCrabJobManager(via law'scrab_job_manager_clshook) that:and nothing is printed;
task with no per-job info yet — and prints one line for the task, not one per job, so the
poll completes normally and the other task keeps making progress;
quietly stalls is worse than one that stops.
On adding a distinct "new" status
Considered and not done. law's status vocabulary is a fixed set (pending / running / finished /
retry / failed) that the status line and the poll accounting are built on, and a freshly submitted
task legitimately is waiting — pending says that correctly. A sixth bucket would change the
display without touching the actual problem here, which is that an unreadable response is treated as
a fatal per-job error. Tolerating the response fixes the noise and the lost poll iterations together.
Testing
Nine checks against a fake status query:
query_retries + 1{task: 1}job_idsomittedmkdocs build --strictpasses;run_tools/apply_format.shis a no-op on the diff.Not yet exercised against a real flaky response — the condition is transient and I cannot
reproduce it on demand. The retry path is what production will exercise first.