Report panics using the top-level frame id rather than the pipeline id#14173
Conversation
|
Heads up! This PR modifies the following files:
|
|
I learned the hard way not to cc people or mention issues in the PR summary... This is part of fixing #633, hopefully the last remaining place that script threads assume there's a root pipeline. cc @jdm @ConnorGBrewster @paulrouget |
b74fe56 to
3ee4354
Compare
|
r? @paulrouget |
3ee4354 to
568cb37
Compare
|
☔ The latest upstream changes (presumably #14246) made this pull request unmergeable. Please resolve the merge conflicts. |
568cb37 to
c228a4c
Compare
|
@paulrouget? This is blocking fixing #633, so it would be nice to land it! |
| warn!("Mozbrowser error after root pipeline closed."); | ||
| match self.frames.get(&top_level_frame_id) { | ||
| None => warn!("Mozbrowser error after top-level frame closed."), | ||
| Some(frame) => match self.pipelines.get(&frame.current.pipeline_id) { |
There was a problem hiding this comment.
Are we 100% sure it's the current pipeline that crashed?
As in, the pipeline we get in handle_send_error, is it always the current pipeline of that frame?
If not, we should pass pipeline_id to handle_panic and trigger_mozbrowsererror, not the frame_id.
There was a problem hiding this comment.
In the case of handle_send_error, all we know is that we tried sending to a pipeline which had closed its constellation channel (most likely because the pipeline exited). We could try being more precise in this case, but most panics come in via as log messages, where all we get is the frame id, not the pipeline id.
There was a problem hiding this comment.
Re-reading that code. I was confused about using frame.current, which is only used to get the parent frame (not to identify the failing pipeline).
There was a problem hiding this comment.
Yes, this is an artefact of the parent info being stored in the pipeline rather than the frame, where it should be. At some point we might fix that.
|
@bors-servo r+ |
|
🔑 Insufficient privileges |
|
Ah, you're not on the blessed list? |
|
@bors-servo r=paulrouget delegate=paulrouget |
|
✌️ @paulrouget can now approve this pull request |
|
📌 Commit c228a4c has been approved by |
|
Thanks! |
…e-id, r=paulrouget Report panics using the top-level frame id rather than the pipeline id <!-- Please describe your changes on the following line: --> At the moment, we report panics from script and layout using the root pipeline id. Once we are sharing more script threads, there won't be a root pipeline id any more. The plan is only to share script threads in the same tab, so there will be a top-level frame id that all the pipelines have in common. This PR reports panics using that top-level frame id. This mostly makes a difference to the browser API: rather than targeting a `mozbrowsererror` event at the root iframe of the script thread that panicked, it targets it at the containing mozbrowser iframe. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because we don't test crash reporting <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14173) <!-- Reviewable:end -->
|
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
At the moment, we report panics from script and layout using the root pipeline id. Once we are sharing more script threads, there won't be a root pipeline id any more. The plan is only to share script threads in the same tab, so there will be a top-level frame id that all the pipelines have in common. This PR reports panics using that top-level frame id.
This mostly makes a difference to the browser API: rather than targeting a
mozbrowsererrorevent at the root iframe of the script thread that panicked, it targets it at the containing mozbrowser iframe../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is