Skip to content

Removed panic channel, replaced by integrated logging and issue reporting - #12468

Merged
bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:constellation-remove-panic-channel
Jul 21, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:constellation-remove-panic-channel

Conversation

@asajeffrey

@asajeffrey asajeffrey commented Jul 15, 2016 •

Copy link
Copy Markdown
Contributor

Remove the previous ad hoc panic channel, replace it by an integrated logging and panicking mechanism, including crash reporting. All thread panics are now reported, not just content threads.



This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/dom/bindings/global.rs, components/script/dom/dedicatedworkerglobalscope.rs, components/script/script_thread.rs, components/script/dom/window.rs, components/script_layout_interface/message.rs, components/script_traits/lib.rs, components/script_traits/lib.rs, components/script/dom/workerglobalscope.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 15, 2016
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify gfx and script code, but no tests are modified. Please consider adding a test!

@asajeffrey

Copy link
Copy Markdown
Contributor Author

This impacts issue reporting, so cc @Gozala, and removes almost all of the threading / panicking code from util, so cc @Manishearth.

// It's quite difficult to make Servo exit cleanly if some threads have failed.
// Hard fail exists for test runners so we crash and that's good enough.
error!("Pipeline failed in hard-fail mode. Crashing!");
warn!("Pipeline failed in hard-fail mode. Crashing!");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this feed back into the logging chan?

@asajeffrey asajeffrey Jul 17, 2016 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the very next thing is an exit, so it shouldn't matter too much. I made it a warn! rather than an error! so we don't trigger the issue reporting in the (rather unlikely) --hard-fail --browserhtml case.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #11727) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jul 18, 2016
@asajeffrey
asajeffrey force-pushed the constellation-remove-panic-channel branch 2 times, most recently from 559a13c to b3019c6 Compare July 18, 2016 20:21
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Rebased.

@asajeffrey asajeffrey removed the S-needs-rebase There are merge conflict errors. label Jul 18, 2016
@emilio

emilio commented Jul 19, 2016

Copy link
Copy Markdown
Member

First, sorry for the delay reviewing. I love negative diffs, and the code looks good to me.

I left two (uber-minor) nits, and one question.

r=me with or without the nits addressed, but preferably with the question answered please :)

-S-awaiting-review +S-awaiting-answer


Reviewed 21 of 21 files at r1.
Review status: 12 of 21 files reviewed at latest revision, 4 unresolved discussions.


components/constellation/constellation.rs, line 333 [r1] (raw file):

    fn log(&self, record: &LogRecord) {
        if let Some(entry) = log_entry(record) {
            let pipeline_id = PipelineId::installed();

Should we somehow detect when a thread is expected to have a pipeline id installed (via thread_state), and warn (even with a simple message to stderr, to prevent retriggering the mechanism) that is not found?

Or something like debug_assert!(!thread_state::get().is_script() || pipeline_id.is_some()) // etc, for example.


components/msg/constellation_msg.rs, line 313 [r1] (raw file):

    pub fn install(id: PipelineId) {
        PIPELINE_ID.with(|tls| { tls.set(Some(id)) })

nit: The braces here might be excessive.


components/msg/constellation_msg.rs, line 316 [r1] (raw file):

    }

    pub fn installed() -> Option<PipelineId> {

ditto.


Comments from Reviewable

@emilio emilio added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 19, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #12426) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jul 20, 2016
@asajeffrey
asajeffrey force-pushed the constellation-remove-panic-channel branch from b3019c6 to fd27ca6 Compare July 20, 2016 15:04
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 20, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Rebased.

@asajeffrey

Copy link
Copy Markdown
Contributor Author

It would be nice to add a check that the thread-local pipeline id is set whenever the thread state says it should be, but I'd be concerned about putting it in the logging code. For example, logging during panic is quite common, and if the logging panics, then we'll get a double panic and the whole of servo will close. So I'd rather leave this un-asserted, even in debug mode.

@asajeffrey

Copy link
Copy Markdown
Contributor Author

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit fd27ca6 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. S-awaiting-answer Someone asked a question that requires an answer. labels Jul 20, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit fd27ca6 with merge 29b0dea...

bors-servo pushed a commit that referenced this pull request Jul 20, 2016
… r=emilio

Removed panic channel, replaced by integrated logging and issue reporting

<!-- Please describe your changes on the following line: -->

Remove the previous ad hoc panic channel, replace it by an integrated logging and panicking mechanism, including crash reporting. All thread panics are now reported, not just content threads.

---
<!-- 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 fix #11838
- [X] These changes do not require tests because we don't test error 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/12468)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 21, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

I think #12516 is a blocker for this landing, unless we disable some of the tests. In --mutliprocess mode, the intermittents become pretty consistent, and in the master branch that's fine because the panic is silently ignored. This PR sends the panic to the constellation, causing the tests to fail (which they should be, the panics shouldn't be dropped).

I think the thing to do may be to disable the consistently failing tests: /eventsource/dedicated-worker/eventsource-constructor-non-same-origin.htm and /eventsource/eventsource-constructor-non-same-origin.htm.

@asajeffrey
asajeffrey force-pushed the constellation-remove-panic-channel branch from 64b085f to c889900 Compare July 21, 2016 02:57
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 21, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Replaced the --hard-fail warning with a println, so the backtrace appears in wpt-test runs.

@bors-servo r=emilio (I'm expecting this to fail because of #12516 but you never know).

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit c889900 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 21, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit c889900 with merge 0bb27dd...

bors-servo pushed a commit that referenced this pull request Jul 21, 2016
… r=emilio

Removed panic channel, replaced by integrated logging and issue reporting

<!-- Please describe your changes on the following line: -->

Remove the previous ad hoc panic channel, replace it by an integrated logging and panicking mechanism, including crash reporting. All thread panics are now reported, not just content threads.

---
<!-- 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 fix #11838
- [X] These changes do not require tests because we don't test error 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/12468)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 21, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

#12518 seems to fix the problems with #12516, hooray!

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit c889900 with merge df1b00d...

bors-servo pushed a commit that referenced this pull request Jul 21, 2016
… r=emilio

Removed panic channel, replaced by integrated logging and issue reporting

<!-- Please describe your changes on the following line: -->

Remove the previous ad hoc panic channel, replace it by an integrated logging and panicking mechanism, including crash reporting. All thread panics are now reported, not just content threads.

---
<!-- 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 fix #11838
- [X] These changes do not require tests because we don't test error 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/12468)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 21, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use logging mechanism for panic reporting

7 participants