Closed Bug 1416977 Opened 2 years ago Closed 2 years ago

ValueError: I/O operation on closed file during mozlog.structuredlog on Windows

Categories

(Testing :: Mozbase, defect)

Version 3
Unspecified
Windows
defect
Not set

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: glandium, Assigned: gbrown)

References

Details

Attachments

(1 file)

STR:
- Open Treeherder on e.g. mozilla-central
- Select a green windows build
- Select "failure classification"
- See the 7 "ValueError: I/O operation on closed file" items with links into the build log.

Expected result:
- "No error lines reported"

While it's not really a problem on green jobs, it becomes one when the jobs are red because of a make check error, because you now have those 7 errors along with your own, and you first have to figure out that those 7 errors have nothing to do with your changes, and have been there for a while, even on green runs.
Whichever test job I select I always see `No error lines reported`. Can you please point out a specific job which shows this problem?
Flags: needinfo?(mh+mozilla)
(In reply to Henrik Skupin (:whimboo) from comment #1)
> Whichever test job I select I always see `No error lines reported`. Can you
> please point out a specific job which shows this problem?

Choose a *build* job, not a test job. Those tests are running during make check during the build.
Flags: needinfo?(mh+mozilla)
I see. So here a query for autoland:

https://treeherder.mozilla.org/#/jobs?repo=autoland&filter-searchStr=build%20windows&bugfiler&filter-resultStatus=success&filter-resultStatus=runnable

https://treeherder.mozilla.org/logviewer.html#?job_id=144872600&repo=autoland&lineNumber=39115

08:30:46     INFO - mozlog.structuredlog: Failure calling log handler:
08:30:46     INFO - Traceback (most recent call last):
08:30:46     INFO -   File "z:\build\build\src\testing\mozbase\mozlog\mozlog\structuredlog.py", line 237, in _handle_log
08:30:46     INFO -     handler(data)
08:30:46     INFO -   File "z:\build\build\src\testing\mozbase\mozlog\mozlog\handlers\base.py", line 101, in __call__
08:30:46     INFO -     self.stream.write(formatted.encode("utf-8", "replace"))
08:30:46     INFO - ValueError: I/O operation on closed file
OS: Unspecified → Windows
Please fix this, because it makes other errors misattributed to bug 1420472.
I debugged this a little and determined that the ValueError is thrown by the handler created by test_utf8str_write.
Assignee: nobody → gbrown
Comment on attachment 8939094 [details] [diff] [review]
remove handler before its file is closed

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

Thanks for debugging this Geoff!
Attachment #8939094 - Flags: review?(ahalberstadt) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/311f264cc818
Ensure handler removed before file closed in test_structured.py; r=ahal
https://hg.mozilla.org/mozilla-central/rev/311f264cc818
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
See Also: → 1420472
You need to log in before you can comment on or make changes to this bug.