Closed Bug 1694275 Opened 3 years ago Closed 3 years ago

mozprocess waits for output despite exception

Categories

(Testing :: Mozbase, defect)

Default
defect

Tracking

(firefox88 fixed)

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: aerickson, Assigned: gbrown)

References

Details

Attachments

(3 files)

I found a failed browsertime linux job that waited an hour to fail, despite browsertime failing to start and throwing an exception almost immediately. mozprocess ignored the exception and continued to wait for output for an hour.

It seems like mozprocess should exit immediately on an exception. Or should browsertime be using a different functions or args with mozprocess?

Log attached (task https://firefox-ci-tc.services.mozilla.com/tasks/fME8UIgGSROwv6ADaXAaNg/runs/1).

Attachment #9204695 - Attachment mime type: application/octet-stream → text/plain;charset=UTF-8

afaik, mozprocess makes no promises about its behavior when, as happens here, a line handler (stdoutProcessLine, stdout_callback) throws an exception. It looks to me like the exception is not handled, and the ProcessReader thread ends; other mozprocess threads continue. My initial reaction is that raptor's line handler should not throw an exception, but rather signal mozprocess to end, perhaps with kill()?

...and mozprocess should catch and report the exception, but not end...maybe?

I can follow-up on those ideas, if no one else is interested.

Assignee: nobody → whole.grains

The python subprocess module keeps getting better, while mozprocess is poorly
maintained and subject to various problems (like this bug!), so this patch
adds a comment to mozprocess warning about shortcomings.

(In reply to Geoff Brown [:gbrown] from comment #1)

afaik, mozprocess makes no promises about its behavior when, as happens here, a line handler (stdoutProcessLine, stdout_callback) throws an exception. It looks to me like the exception is not handled, and the ProcessReader thread ends; other mozprocess threads continue. My initial reaction is that raptor's line handler should not throw an exception, but rather signal mozprocess to end, perhaps with kill()?

Agreed. I'll file a raptor bug. Thanks. :)

See Also: → 1694525
Keywords: leave-open
Pushed by whole.grains@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/7fe4781d1bdd
Add comment to mozprocess warning about shortcomings; r=jmaher

Catch and report any exceptions raised in mozprocess callbacks. This allows the
ProcessReader thread to continue and mozprocess to function normally following
an exception raised in client code.

Keywords: leave-open
Pushed by whole.grains@protonmail.com:
https://hg.mozilla.org/integration/autoland/rev/8c7a7a88444f
Handle exceptions in mozprocess callbacks; r=jmaher
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: