Closed Bug 1162594 Opened 4 years ago Closed 4 years ago

build_resources.json not getting logged in some circumstances

Categories

(Release Engineering :: Applications: MozharnessCore, defect)

defect
Not set

Tracking

(firefox41 fixed)

RESOLVED FIXED
Tracking Status
firefox41 --- fixed

People

(Reporter: mshal, Assigned: mshal)

References

Details

Attachments

(2 files)

Bug 1159838 started logging build_resources.json to influxdb, but some builds don't find the file for some reason. In particular, we haven't posted any stats from any Windows builds yet, and none of the mozilla-central builds worked either. I'm not sure yet if mozharness is looking in the wrong place for the file, or if mach isn't generating it in certain cases, or maybe it's being generated and then deleted before we grab it.
I dug into this a little bit - this appears to be because the 'import psutil' is failing in resourcemonitor.py:

13:50:20     INFO -    File "/builds/slave/try-l64-0000000000000000000000/build/src/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py", line 14, in <module>
13:50:20     INFO -      import psutil
13:50:20     INFO -    File "/builds/slave/try-l64-0000000000000000000000/build/src/python/psutil/psutil/__init__.py", line 89, in <module>
13:50:20     INFO -      import psutil._pslinux as _psplatform
13:50:20     INFO -    File "/builds/slave/try-l64-0000000000000000000000/build/src/python/psutil/psutil/_pslinux.py", line 20, in <module>
13:50:20     INFO -      from psutil import _common
13:50:20     INFO -  ImportError: cannot import name _common

(We don't normally print this exception - the build ignores the error and just proceeds without stat collection so as not to break things over stats).

Bug 893254 covers deploying psutil to more places, which should get us the mach stats for every build, I think.
Depends on: 893254
I'd like to record at least the duration of the various mach tiers even if we don't have psutil. This just stubs out the psutil functions if it fails to import, but we still get a build_resources.json at the end of the build with durations that can be logged to influx.
Attachment #8617682 - Flags: review?(mh+mozilla)
Attachment #8617682 - Flags: review?(mh+mozilla) → review?(ahalberstadt)
Comment on attachment 8617682 [details] [diff] [review]
0001-Bug-1162594-create-build_resources.json-even-if-psut.patch

Strangely this works on Linux & Windows, but not Mac. I need to look into it some more...
Attachment #8617682 - Flags: review?(ahalberstadt)
Comment on attachment 8617682 [details] [diff] [review]
0001-Bug-1162594-create-build_resources.json-even-if-psut.patch

This part is fine - just need a mozharness patch to make sure it looks in the right place for the file.
Attachment #8617682 - Flags: review?(ahalberstadt)
Attached patch buildresourcesSplinter Review
Attachment #8620553 - Flags: review?(jlund)
Assignee: nobody → mshal
Comment on attachment 8620553 [details] [diff] [review]
buildresources

Review of attachment 8620553 [details] [diff] [review]:
-----------------------------------------------------------------

moar config items! ;)
Attachment #8620553 - Flags: review?(jlund) → review+
Comment on attachment 8617682 [details] [diff] [review]
0001-Bug-1162594-create-build_resources.json-even-if-psut.patch

Review of attachment 8617682 [details] [diff] [review]:
-----------------------------------------------------------------

This looks safe enough and I'm ok with it going into mozbase, so r+.. but gps originally wrote this code and I'm not familiar with psutil.. so take that r+ with a grain of salt. If you feel this warrants a more proper review I suggest flagging him.
Attachment #8617682 - Flags: review?(ahalberstadt) → review+
https://hg.mozilla.org/mozilla-central/rev/86016bd9da3b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.