diff options
author | Mike Hommey <mh+mozilla@glandium.org> | 2017-08-16 13:16:16 +0900 |
---|---|---|
committer | Leorize <alaviss@users.noreply.github.com> | 2018-05-16 17:04:09 +0700 |
commit | 18dec100cc21de643470cfd9554f36daf9cb8273 (patch) | |
tree | 5dddcf7018b735513928852e2a0bc920989581d4 /editor/libeditor/tests/test_bug1257363.html | |
parent | 000ac0cc833c415169ed7aa8c5e3493d0d4525fd (diff) | |
download | UXP-18dec100cc21de643470cfd9554f36daf9cb8273.tar UXP-18dec100cc21de643470cfd9554f36daf9cb8273.tar.gz UXP-18dec100cc21de643470cfd9554f36daf9cb8273.tar.lz UXP-18dec100cc21de643470cfd9554f36daf9cb8273.tar.xz UXP-18dec100cc21de643470cfd9554f36daf9cb8273.zip |
Bug 1384062 - Make SystemResourceMonitor.stop more resilient to errors. r=ahal,gps
The poll() call in SystemResourceMonitor.stop might fail even though
there is something to read from the pipe, in some corner cases, and
python won't let us know about it. In that case, an exception is thrown,
leaving the SystemResourceMonitor (and its callers) in a weird state. In
practice, this leads BuildMonitor.__exit__ to recall stop, which then
fails.
So when poll() throws an exception, we pretend there's still something
to read, and we try to read anyways. If there is something to read,
recv() will return it, otherwise, it will throw an exception of its own,
which we catch, pretending we're done.
Furthermore, when there is nothing to read from the pipe, poll() simply
returns False, and our loop never sets `done` to True, and we then hit
an assert, which doesn't have its place here, so we remove it.
Finally, the other end of the pipe might have died at any time, making
sending over the pipe fail, so we also protect against that.
With all these changes, it feels like the reason to backout bug 1239939
in bug 1272782 should have been dealt with, and we can drop the timeout
again.
--HG--
extra : rebase_source : ac72dd5b2602cf3ffddfb429f95e02380f939893
Diffstat (limited to 'editor/libeditor/tests/test_bug1257363.html')
0 files changed, 0 insertions, 0 deletions