Closed Bug 1626590 Opened 5 years ago Closed 5 years ago

histograms not needed anymore in histogram-allowlists.json should be called out more explicitly

Categories

(Toolkit :: Telemetry, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: aryx, Assigned: chutten)

Details

Attachments

(1 file)

In bug 1625409 tracebacks had been noticed which got printed because a histogram should have been removed from histogram-allowlists.json.

Because these messages are printed for a green build task, they are missed by people who are not explicitly checking for them. On the other hand, letting the build task fail for them but prevent any of the dependent test tasks from running.

Can these checks be moved to a test task and fail in that one?

The allowlists are checked as part of the code generation step. We intend the build to fail on these because we can't be certain what code we're supposed to generate. Has it always resulted in a successful build? I could've sworn it failed for me locally when I implemented it all those years ago.

Flags: needinfo?(aryx.bugmail)

Yes, always passed for almost a day until it got detected by an out-of-tree script scanning for failure lines in tasks.

Flags: needinfo?(aryx.bugmail)

Can we turn it more directly into a build failure? The generated code is not guaranteed to be correct.

We're creating a ParserError here which is printed and then exit(1)'d here... is that not enough to fail the build?

Flags: needinfo?(aryx.bugmail)

(In reply to Chris H-C :chutten from comment #3)

Can we turn it more directly into a build failure? The generated code is not guaranteed to be correct.

OK.

We're creating a ParserError here which is printed and then exit(1)'d here... is that not enough to fail the build?

Should the sys.exit(1) be a raise ParserError instead? https://hg.mozilla.org/mozilla-central/rev/92dbf32cc3526258daebc6281204224b7ca49dc4 dropped that.

Flags: needinfo?(aryx.bugmail) → needinfo?(chutten)

Raising an error doesn't seem to fail the build either. Maybe GeneratedFile doesn't fail on failures? Do you know anyone who'd know something about generated files in the build system?

Flags: needinfo?(chutten) → needinfo?(aryx.bugmail)

Can you answer Chris' equestion about generated files?

Flags: needinfo?(aryx.bugmail) → needinfo?(mh+mozilla)

I bet this is the problem:

$ cat > foo.py <<EOF
import atexit
import sys

def foo():
    sys.exit(1)

atexit.register(foo)
EOF
$ python foo.py
$ echo $?
1
$ python3 foo.py
$ echo $?
0

GeneratedFiles have switched to python 3 by default in bug 1611326.

Flags: needinfo?(mh+mozilla)

https://bugs.python.org/issue27035

Looks like the new behaviour is being defended and there isn't a plan for a designed solution as of yet. Lemme try the _exit workaround mentioned in the comments.

Also: os._exit is much faster than sys.exit, so remember to flush stderr or
we won't see the errors we just printed.

Assignee: nobody → chutten
Status: NEW → ASSIGNED
Type: task → defect
Priority: -- → P1
Pushed by chutten@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e83007a7ebe Use os._exit not sys.exit in atexit in Python3 r=glandium,janerik

[task 2020-04-08T18:52:10.278Z] 18:52:10 ERROR - check> E TypeError: 'flush' is an invalid keyword argument for this function

It is?

[task 2020-04-08T18:52:10.271Z] 18:52:10 INFO - check> platform linux2 -- Python 2.7.9, pytest-3.6.2, py-1.5.4, pluggy-0.6.0 -- /builds/worker/workspace/obj-build/_virtualenvs/obj-build-1hbI4qbY-2.7/bin/python

Ohhh. I thought we were Python3 through and through? Apparently not. I guess I'll need to flush stderr itself instead of telling print to do the right thing for me. (flush is on io.IOBase in both 2 and 3)

Flags: needinfo?(chutten)
Pushed by chutten@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a66e5e777cd1 Use os._exit not sys.exit in atexit in Python3 r=glandium,janerik
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: