Skip to content

Implement document load cancellation - #21111

Merged
bors-servo merged 6 commits into
servo:masterfrom
gterzian:implement_document_load_cancellation
Jul 29, 2018
Merged

bors-servo merged 6 commits into
servo:masterfrom
gterzian:implement_document_load_cancellation

Conversation

@gterzian

@gterzian gterzian commented Jul 1, 2018 •

Copy link
Copy Markdown
Member

  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive

highfive commented Jul 1, 2018

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/eventsource.rs, components/script/dom/document.rs, components/script/dom/window.rs, components/script/dom/webidls/Window.webidl, components/script/document_loader.rs
  • @KiChjang: components/script/dom/eventsource.rs, components/script/dom/document.rs, components/script/dom/window.rs, components/script/dom/webidls/Window.webidl, components/script/document_loader.rs

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

highfive commented Jul 1, 2018

Copy link
Copy Markdown

warning Warning warning

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

@gterzian

gterzian commented Jul 1, 2018

Copy link
Copy Markdown
Member Author

Not ready for review yet...

@gterzian
gterzian force-pushed the implement_document_load_cancellation branch from 962e8e8 to 925b929 Compare July 1, 2018 14:22
@KiChjang

KiChjang commented Jul 2, 2018

Copy link
Copy Markdown
Contributor

We should probably also use this opportunity to rename cancel to terminate, since that's the exact same term used by the spec.

// the user agent must abort any instance of the fetch algorithm opened by this EventSource.
self.canceller.borrow_mut().cancel();
}
}

@gterzian gterzian Jul 2, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Question on this: is the Drop of a Rust DomRoot going to be called when the associated JsObject is garbage collected in the JS engine?

(The above might be un-necessary since I've also added a change that make the globalscope keep a reference to all EventSource, and cancel them manually when needed, could still be a good backup ensuring we indeed always abort the fetch if the JSObject is garbarge collected)

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.

Yes.

bors-servo pushed a commit that referenced this pull request Jul 13, 2018
…tsource, r=jdm

Use remote-event task source in EventSource

<!-- Please describe your changes on the following line: -->
Follow up on #21126, this again 'changes nothing', but will be useful for #21111 in the context of #21114

Trying to break up work into smaller PR's ;)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21112 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21170)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Jul 13, 2018
…tsource, r=jdm

Use remote-event task source in EventSource

<!-- Please describe your changes on the following line: -->
Follow up on #21126, this again 'changes nothing', but will be useful for #21114 in the context of #21111.

Trying to break up work into smaller PR's ;)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21112 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21170)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Jul 14, 2018
…tsource, r=jdm

Use remote-event task source in EventSource

<!-- Please describe your changes on the following line: -->
Follow up on #21126, this again 'changes nothing', but will be useful for #21114 in the context of #21111.

Trying to break up work into smaller PR's ;)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21112 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21170)
<!-- Reviewable:end -->
@gterzian
gterzian force-pushed the implement_document_load_cancellation branch from 0dd5c53 to dcdebd8 Compare July 21, 2018 02:24

// TODO: https://github.com/servo/servo/issues/15236
self.window.cancel_all_tasks();
self.window.cancel_all_tasks_from_source(TaskSourceName::Networking);

@KiChjang KiChjang Jul 21, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This carries an assumption that all the tasks queued on the networking task source are fetches. I think it is ok for now, but we'd definitely want to leave a comment here clarifying the assumption.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, I'll add a note.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've also filed whatwg/html#3837

Comment thread components/script/dom/eventsource.rs Outdated
fn process_response_done(&mut self, aborted:bool) {
if aborted {
// https://html.spec.whatwg.org/multipage/
// server-sent-events.html#sse-processing-model:fail-the-connection

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, thanks!

@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 99b7f30 with merge fa6711c...

bors-servo pushed a commit that referenced this pull request Jul 22, 2018
… r=<try>

[WIP] Implement document load cancellation

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19309 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21111)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 22, 2018
@gterzian

Copy link
Copy Markdown
Member Author
Error:
/home/servo/buildbot/slave/linux-dev/build/python/_virtualenv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
  utils.DeprecatedIn23,
awscli 1.15.56 has requirement botocore==1.10.55, but you'll have botocore 1.5.95 which is incompatible.

servo/saltfs#862

@gterzian
gterzian force-pushed the implement_document_load_cancellation branch from 99b7f30 to d91ce07 Compare July 22, 2018 08:50
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 22, 2018
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try (some servers still work, and I'd like to know where I stand in terms of the overall test suite)

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit d91ce07 with merge 267c721...

bors-servo pushed a commit that referenced this pull request Jul 22, 2018
… r=<try>

[WIP] Implement document load cancellation

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19309 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21111)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 22, 2018
@jdm

jdm commented Jul 28, 2018

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit dbdfda8 has been approved by jdm

@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 28, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit dbdfda8 with merge 94120c2...

bors-servo pushed a commit that referenced this pull request Jul 28, 2018
… r=jdm

Implement document load cancellation

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #19309 fix #21114 fix #21113 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21111)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - arm32

@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 28, 2018
@jdm

jdm commented Jul 28, 2018

Copy link
Copy Markdown
Member

More build machine disk space woes.

@gterzian

Copy link
Copy Markdown
Member Author

This one has come back, and this time it's OK...

{"status": "OK", "group": "default", "message": null, "stack": null, "subtest": null, "test": "/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html", "line": 94095, "action": "test_result", "expected": "TIMEOUT"}

@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit dbdfda8 with merge e543cba...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@gterzian

Copy link
Copy Markdown
Member Author

Ok, removed the TIMEOUT for {"status": "OK", "group": "default", "message": null, "stack": null, "subtest": null, "test": "/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html", "line": 94095, "action": "test_result", "expected": "TIMEOUT"

@jdm

jdm commented Jul 29, 2018

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit e67adfc has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e67adfc with merge 076198f...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: jdm
Pushing 076198f to master...

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

Labels

None yet

Projects

None yet

6 participants