Closed Bug 1368342 Opened 3 years ago Closed 3 years ago

[mozlog] Using loggers across processes is racy

Categories

(Testing :: Mozbase, enhancement)

Version 3
enhancement
Not set

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jgraham, Assigned: jgraham)

Details

Attachments

(1 file)

mozlog protects access to stdout (or any other stream) with a threading.Lock. This works fine for multithreaded use cases, but doesn't work too well for cases involving multiple processes and can lead to garbled output. Using a multiprocessing lock is likely too expensive in general. A better solution, particularly for the common case where one process does most logging, is to queue messages coming from child processes.
Comment on attachment 8872162 [details]
Bug 1368342 - Add mozlog logger that goes via a queue,

https://reviewboard.mozilla.org/r/143634/#review147638

Clever, looks good!
Attachment #8872162 - Flags: review?(ahalberstadt) → review+
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/c9d839d793c6
Add mozlog logger that goes via a queue, r=ahal
https://hg.mozilla.org/mozilla-central/rev/c9d839d793c6
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee: nobody → james
You need to log in before you can comment on or make changes to this bug.