Skip to content

Use a threadpool for fetch - #22769

Merged
bors-servo merged 1 commit into
servo:masterfrom
gterzian:use_thread_pool_in_resource_thread
Apr 19, 2019
Merged

bors-servo merged 1 commit into
servo:masterfrom
gterzian:use_thread_pool_in_resource_thread

Conversation

@gterzian

@gterzian gterzian commented Jan 27, 2019 •

Copy link
Copy Markdown
Member

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

This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/net/Cargo.toml, components/net/resource_thread.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 27, 2019
@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch from fb6588d to 4309655 Compare January 27, 2019 12:33
@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch 4 times, most recently from 521758e to e8ed65c Compare January 28, 2019 07:18
@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Feb 4, 2019
@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch from e8ed65c to e25bbd7 Compare February 12, 2019 06:09
@gterzian gterzian removed the S-needs-rebase There are merge conflict errors. label Feb 12, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 11, 2019
@jdm

jdm commented Apr 11, 2019

Copy link
Copy Markdown
Member

Oops, awkward. r=me if this gets rebased.

@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch 2 times, most recently from ffcb4e6 to c7c8804 Compare April 12, 2019 10:38
@gterzian

Copy link
Copy Markdown
Member Author

Ok, rebased @jdm

Comment thread tests/wpt/mozilla/meta/MANIFEST.json Outdated
],
"mozilla/fetch_cannot_overwhelm_system.window.js": [
[
"/_mozilla/mozilla/fetch_cannot_overwhelm_system.window.html",

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.

Could you run ./Mach update-manifest?

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'm looking into it, it seems to not have any effect...

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.

Try manually removing the /_mozilla/ prefix, in that case.

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.

Ok, I've filed #23214

@jdm

jdm commented Apr 16, 2019

Copy link
Copy Markdown
Member

Looks like one more ./mach fmt is required.
@bors-servo delegate+

@bors-servo

Copy link
Copy Markdown
Contributor

✌️ @gterzian can now approve this pull request

@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch from d0e1a5e to 1e40c64 Compare April 16, 2019 16:17
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo r=jdm

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 1e40c64 has been approved by jdm

@highfive highfive assigned jdm and unassigned ferjm Apr 16, 2019
@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 16, 2019
@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 18, 2019
@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch from a1af9ea to 1745ad4 Compare April 18, 2019 12:15
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Apr 18, 2019
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try=wpt

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 1745ad4 with merge 4f0fa16...

bors-servo pushed a commit that referenced this pull request Apr 18, 2019
…=<try>

Use a threadpool for fetch

<!-- 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 #22768 (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/22769)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@jdm

jdm commented Apr 18, 2019

Copy link
Copy Markdown
Member

@bors-servo r=nox

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 1745ad4 has been approved by nox

@highfive highfive assigned nox and unassigned jdm Apr 18, 2019
@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 18, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 1745ad4 with merge d6a36da...

@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 18, 2019
bors-servo pushed a commit that referenced this pull request Apr 18, 2019
…=nox

Use a threadpool for fetch

<!-- 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 #22768 (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/22769)
<!-- Reviewable:end -->
@gterzian
gterzian force-pushed the use_thread_pool_in_resource_thread branch from 1745ad4 to c52cfda Compare April 18, 2019 13:40
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Apr 18, 2019
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo r=nox

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit c52cfda has been approved by nox

@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 Apr 19, 2019
bors-servo pushed a commit that referenced this pull request Apr 19, 2019
…=nox

Use a threadpool for fetch

<!-- 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 #22768 (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/22769)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit c52cfda with merge c449cbb...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android-mac, arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, magicleap, status-taskcluster
Approved by: nox
Pushing c449cbb to master...

@bors-servo
bors-servo merged commit c52cfda into servo:master Apr 19, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 19, 2019
@gterzian
gterzian deleted the use_thread_pool_in_resource_thread branch January 7, 2020 12:16
jschwe added a commit to openharmony-rs/servo-ohos that referenced this pull request Nov 18, 2026
…ll file

The test sent 5,000 asynchronous XMLHttpRequests for `/`, the directory
listing of the WPT server, and finished 10 ms later without waiting for
them. Servo opens a connection per request, so the shared WPT server
then spent tens of seconds answering the listings while the other test
runners waited for their test pages and testharness.js. Tests that
started in that window timed out or were reported as CRASH ("Browser
not responding"), e.g. three flaky results of the QuickJS WPT job of
servo-ohos#55 (run 44176987934), which all started within 0.3 s after
this test ended on another runner. A crash caused by the requests would
also have been attributed to the next test.

Request /common/blank.html, an empty file, and finish when every
request has ended (`loadend`), with the long timeout. The test still
checks what it was added for in servo#22769 (servo#22768): that
thousands of concurrent fetches don't crash the browser.

Validation: host checked-release build of this stack, `./mach test-wpt --processes 4 tests/wpt/mozilla/tests/mozilla`: 316 tests as expected; this test takes 3.3 s and the tests started within 2 s after it on the other runners 0.1-0.6 s (except http-cache-xhr.html, an expected timeout). Alone, `--repeat 5` in one browser: OK each time, 1.9 s, then 9-14 s per run (the earlier runs' connections stay open), within the long timeout. Measured before the change, with a probe of testharness.js every 200 ms on the WPT server: the old test ends after 0.07 s, the next test then takes 6.1 s and the probe waits 5.7 s; this version takes 2.4 s with the probe waiting at most 0.5 s and the next test 0.05 s.
AI-assisted: Yes (agent session; the agent found the cause of the flaky results, wrote and measured the change)
Signed-off-by: Jonathan Schwender <[email protected]>
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.

Prevent panic arising from too many fetch threads

6 participants