Skip to content

Commit

Permalink
Correctly treating cases when bootstrap is failed
Browse files Browse the repository at this point in the history
  • Loading branch information
kandrosov committed Jun 6, 2023
1 parent 548393e commit d819f43
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crabTaskStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,19 @@ def to_seconds(hh_mm_ss):

return n + shift

def task_boostrapped(task_status, log_lines, n, value):
def task_bootstrapped(task_status, log_lines, n, value):
if n + 1 >= len(log_lines) or log_lines[n + 1].strip() != LogEntryParser.status_will_be_available:
raise RuntimeError("Unexpected bootstrap message")
task_status.status = Status.Bootstrapped
return n + 2

def bootstrap_failed(task_status, log_lines, n, value):
task_status.status_on_scheduler = StatusOnScheduler.FAILED
n += 1
if log_lines[n].strip().startswith('Hold reason:'):
n += 1
return n

def details(task_status, log_entries, n, value):
task_status.details = json.loads(log_entries[n])
return n + 1
Expand All @@ -315,9 +322,10 @@ def details(task_status, log_entries, n, value):
"Error Summary:": error_summary,
"Log file is": "crab_log_file",
"Summary of run jobs:": run_summary,
"Task bootstrapped": task_boostrapped,
"Task bootstrapped": task_bootstrapped,
"Failure message from server:": failure,
"{": details,
"The task failed to bootstrap on the Grid scheduler": bootstrap_failed,
}
error_summary_end = "Have a look at https://twiki.cern.ch/twiki/bin/viewauth/CMSPublic/JobExitCodes for a description of the exit codes."
status_will_be_available = "Status information will be available within a few minutes"
Expand Down

0 comments on commit d819f43

Please sign in to comment.