Closed
Bug 1126038
Opened 9 years ago
Closed 9 years ago
Finish decoding off-main-thread
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: seth, Assigned: seth)
References
Details
Attachments
(1 file, 1 obsolete file)
6.61 KB,
patch
|
tnikkel
:
review+
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Right now, Decoder::Finish only runs on the main thread. This is problematic for two reasons: 1. It wastes main thread resources, because much of the work in Decoder::Finish can actually be done off-main-thread. 2. More seriously, it can cause deadlock, because for some image formats we don't call Decoder::PostFrameStop (which is responsible for calling imgFrame::Finish) until we call Decoder::Finish, and if the main thread is blocked in imgFrame::WaitUntilComplete, waiting for that imgFrame::Finish call on the same frame... kaboom. So let's fix this. I actually think the whole decoder shutdown sequence needs a complete refactoring (we have Decoder::Finish, Decoder::FinishInternal, RasterImage::OnDecodingComplete, RasterImage::FinalizeDecoder... too much, and in this bug I'll make it worse) and I intend to file a bug to do that soon, but I think this particular issue should be fixed separately. For one thing, it's blocking the landing of bug 1125490, but it's also generally important and I don't want it to get backed out if I make a mistake in the subsequent refactoring.
Assignee | ||
Updated•9 years ago
|
Component: Layout: Images → ImageLib
Assignee | ||
Comment 2•9 years ago
|
||
Try job here: https://tbpl.mozilla.org/?tree=Try&rev=f218fdbcd699
Assignee | ||
Comment 3•9 years ago
|
||
The tests there look good except for a devtools failure which is caused by us failing to print a error to the console for a corrupt image. This seems to be because the code in CompleteDecode() considers the image usable and calls PostFrameStop(), PostDecodeDone(), etc., so we don't enter the similar |if| branch in Finish(). This version of the patch is the same except that I've added a flag to remember that we should report an error to the console in Finish(). New Linux-only try job here, to verify that this fixes the problem: https://tbpl.mozilla.org/?tree=Try&rev=016dd3de7eaf
Attachment #8554953 -
Flags: review?(tnikkel)
Assignee | ||
Updated•9 years ago
|
Attachment #8554849 -
Attachment is obsolete: true
Attachment #8554849 -
Flags: review?(tnikkel)
Updated•9 years ago
|
Attachment #8554953 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 4•9 years ago
|
||
Thanks for the review! Pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/00f4c6c6f553
Comment 5•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/00f4c6c6f553
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8554953 [details] [diff] [review] Finish decoding off-main-thread Approval Request Comment [Feature/regressing bug #]: Part of fix for bug 1125272 and bug 1119938. [User impact if declined]: Already approved. [Describe test coverage new/current, TreeHerder]: In 38 for a long time. [Risks and why]: Low risk; in 38 for a long time. [String/UUID change made/needed]: None.
Attachment #8554953 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 7•9 years ago
|
||
Pushed to Aurora: https://hg.mozilla.org/releases/mozilla-aurora/rev/6dc06329002f
status-firefox37:
--- → fixed
status-firefox38:
--- → fixed
Comment 8•9 years ago
|
||
Comment on attachment 8554953 [details] [diff] [review] Finish decoding off-main-thread Aurora approval previously granted for a collection of ImageLib related bugs that Seth worked on and QE verified before uplift.
Attachment #8554953 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in
before you can comment on or make changes to this bug.
Description
•