Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Jul 15, 2016

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.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #11838
  • These changes do not require tests because we don't test error reporting

This change is Reviewable

@highfive
Copy link

highfive commented Jul 15, 2016

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
Copy link

highfive commented Jul 15, 2016

warning Warning warning

  • These commits modify gfx and script code, but no tests are modified. Please consider adding a test!
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 15, 2016

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

if opts::get().hard_fail {
// 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!");

This comment has been minimized.

Copy link
@Manishearth

Manishearth Jul 16, 2016

Member

Won't this feed back into the logging chan?

This comment has been minimized.

Copy link
@asajeffrey

asajeffrey Jul 17, 2016

Author Member

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
Contributor

bors-servo commented Jul 18, 2016

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

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-remove-panic-channel branch 2 times, most recently from 559a13c to b3019c6 Jul 18, 2016
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 18, 2016

Rebased.

@emilio
Copy link
Member

emilio commented Jul 19, 2016

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

@bors-servo
Copy link
Contributor

bors-servo commented Jul 20, 2016

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

@asajeffrey asajeffrey force-pushed the asajeffrey:constellation-remove-panic-channel branch from b3019c6 to fd27ca6 Jul 20, 2016
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 20, 2016

Rebased.

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 20, 2016

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
Member Author

asajeffrey commented Jul 20, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jul 20, 2016

📌 Commit fd27ca6 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jul 20, 2016

Testing commit fd27ca6 with merge 29b0dea...

bors-servo added 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 -->
@asajeffrey asajeffrey mentioned this pull request Jul 20, 2016
2 of 9 tasks complete
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

💔 Test failed - linux-rel

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 21, 2016

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 asajeffrey:constellation-remove-panic-channel branch from 64b085f to c889900 Jul 21, 2016
@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 21, 2016

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
Contributor

bors-servo commented Jul 21, 2016

📌 Commit c889900 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

Testing commit c889900 with merge 0bb27dd...

bors-servo added 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
Contributor

bors-servo commented Jul 21, 2016

💔 Test failed - linux-rel

@asajeffrey
Copy link
Member Author

asajeffrey commented Jul 21, 2016

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

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2016

Testing commit c889900 with merge df1b00d...

bors-servo added 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
Contributor

bors-servo commented Jul 21, 2016

@bors-servo bors-servo merged commit c889900 into servo:master Jul 21, 2016
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.