Repository navigation
Conversation
When setJobAttributes is called with update=True and a Status, the status and the LastUpdateTime were written by two separate statements. In between, a freshly matched job that had been waiting for longer than MatchedTime looked like a job stuck in Matched, and the StalledJobAgent could reschedule it while the pilot went on to run it. The job then stays in Checking forever, as the state machine rejects the pilot's updates.
Jobs selected as stuck in Matched or Rescheduled may have moved on by the time they are rescheduled, so check each one again just before acting. Also record the StalledJobAgent as the source of the reschedule in the job logging.
chrisburr
marked this pull request as ready for review
October 22, 2026 22:46
This branch has not been deployed
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.
The Matcher sets a job to
MatchedwithJobDB.setJobAttributes(..., update=True), which writesStatusandLastUpdateTimein two separate statements. In between, a job that sat inWaitingfor longer thanMatchedTimelooks exactly like a job stuck inMatched. If the StalledJobAgent's_kickStuckJobsselects in that window, it reschedules the job while the pilot goes on to run it.The pilot then runs the payload successfully, but the job never leaves
Checking: the state machine refusesChecking -> Running/Done, so only the minor and application statuses of the wrapper are recorded. When theOn Hold: after reschedulingdelay expires, JobScheduling's commit fails because the minor status changed underneath it, and the OptimizationMind never reloads it because its minor status is not an optimizer name. In LHCb this strands about one successful job per day.Timeline of one such job (2026-10-19, UTC):
Waiting,LastUpdateTime= 05:59:51Rescheduling 2 jobs stuck in Matched statusMatched / Assigned:Statuswritten,LastUpdateTimestill 05:59:51 (2h51m old >MatchedTime)Matched / Job Received by AgentReceived / Job RescheduledfromrescheduleJobs()called without asourceInstalling Software,Submitting To CE: the pilot carries on regardlessChecking / JobScheduling,On Hold: after rescheduling 1CheckingChecking / Execution Complete / Job Finished Successfully, never updated againThis PR:
setJobsMajorStatusoptionally refreshLastUpdateTimein the same statement as the status, and uses that fromsetJobAttribute(s)whenupdate=True(withoutmyDate), so the new status is never visible with the old time stamp._kickStuckJobscheck each job again just before rescheduling it, which narrows the separate window between the selection and the rescheduling of a long list of jobs.source="StalledJobAgent"so these reschedules can be attributed in the job logging.BEGINRELEASENOTES
*WorkloadManagement
FIX: set the job Status and LastUpdateTime atomically so that the StalledJobAgent does not reschedule jobs that have just been matched
FIX: StalledJobAgent re-checks stuck jobs before rescheduling them and records itself as the source
ENDRELEASENOTES