Merge lp:~qzhang/lava-scheduler/retrieve-job-fail-reason into lp:lava-scheduler
Status: | Needs review |
---|---|
Proposed branch: | lp:~qzhang/lava-scheduler/retrieve-job-fail-reason |
Merge into: | lp:lava-scheduler |
Diff against target: |
150 lines (+70/-5) 3 files modified
lava_scheduler_app/logfile_helper.py (+63/-3) lava_scheduler_app/models.py (+0/-1) lava_scheduler_daemon/dbjobsource.py (+7/-1) |
To merge this branch: | bzr merge lp:~qzhang/lava-scheduler/retrieve-job-fail-reason |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Spring Zhang (community) | Needs Resubmitting | ||
Zygmunt Krynicki (community) | Needs Fixing | ||
Paul Larson (community) | Disapprove | ||
Review via email: mp+96338@code.launchpad.net |
Description of the change
Based on the job failure reason summary, I made the commit to find out why health job failure from job logfile. If the failure is caused by 'LAVA', I prefer to keep health job status as it is. Other reasons will trigger the board goes offline.
Versus retrieving information from result bundle, I think the log information make sense, I'd like to keep the task getting information from result bundle in the future if necessary.
One question is about job.log_file, is it a string which could be use .find() method as:
if self.logfile.
Unmerged revisions
- 155. By Spring Zhang
-
1. modify nameturple name to a make-sense one
2. use FieldFile to read logfile - 154. By Spring Zhang
-
Add more error message text
- 153. By Spring Zhang
-
modify due to comments
- 152. By Spring Zhang
-
merge from mainline
- 151. By Spring Zhang
-
merge from upstream and revert
- 150. By Spring Zhang
-
Revert to put board offline onece check job failed
- 149. By Spring Zhang
-
Modify due to comments.
1. use namedtuple
2. use class property - 148. By Spring Zhang
-
use flake8 check to align PEP8
- 147. By Spring Zhang
-
Looking for health job failure reason in log file
- 146. By Spring Zhang
-
Set dispatcher error in log file as offline reason
A concern is if the logfile can be reached in job complete jobCompleted_impl, for there is also a getLogFileForJo
bOnBoard( ) in this file.
flake8 (pip install flake8) check your code please
9 +class JobFailReason:
Inherit object please
+ self.type = ["LAVA", "Master Image", "HW"]
Ugly way to specify an enum, I'd prefer
FAULT_LAVA, FAULT_MASTER, FAULT_HW = range(3)
And put it in the class scope
13 + # struct: [ "match string": ["error type", "detail reason"]]
16 + self.match_matrix = [
Array-of-arrays, ugh, use namedtuple to make that readable:
from collections import namedtuple
M = namedtuple("M", "match error detail")
M("tar: You must specify one of the", FAULT_LAVA, "deployment failed due to untar issue"),
... and so on
34 + def get_health_ check_reason( self): check_reason
35 + return self.health_
Useless, attribute was public anyway, remove it
37 + def get_error_ types(self) :
38 + return self.type
This should be a class level property, JobFailReason. FAULT_xxx
+ detail_msg = "\r" + r[1] + " -- " + r[2]
\r ? really?