Skip to content

Http cache: wait on pending stores - #24318

Merged
bors-servo merged 1 commit into
servo:masterfrom
gterzian:http-cache-condvar
Oct 8, 2019
Merged

bors-servo merged 1 commit into
servo:masterfrom
gterzian:http-cache-condvar

Conversation

@gterzian

@gterzian gterzian commented Sep 29, 2019 •

Copy link
Copy Markdown
Member

FIX #24166


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • 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/fetch/methods.rs, components/net/http_loader.rs, components/net/resource_thread.rs, components/net/http_cache.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 29, 2019
@highfive

Copy link
Copy Markdown

warning Warning warning

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

@gterzian gterzian changed the title Http cache condvar Http cache: wait on pending stores Sep 29, 2019
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try=wpt

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 89fe0ba with merge cd5b3cc...

bors-servo pushed a commit that referenced this pull request Sep 29, 2019
Http cache: wait on pending stores

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

---
<!-- 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 #___ (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/24318)
<!-- Reviewable:end -->
@gterzian
gterzian force-pushed the http-cache-condvar branch 2 times, most recently from cbdc65d to 8cdd99a Compare September 30, 2019 02:55
@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try=wpt

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 8cdd99a with merge 30e695f...

bors-servo pushed a commit that referenced this pull request Sep 30, 2019
Http cache: wait on pending stores

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

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

Copy link
Copy Markdown
Contributor

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

@gterzian

Copy link
Copy Markdown
Member Author

@bors-servo try=wpt (split the state per cache key, so fetches don't wait on the condvar unless the pending store relates to their key)

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9407aac with merge c1f701b...

bors-servo pushed a commit that referenced this pull request Sep 30, 2019
Http cache: wait on pending stores

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

---
<!-- 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 #___ (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/24318)
<!-- 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 Sep 30, 2019
@gterzian

Copy link
Copy Markdown
Member Author
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/_webgl/conformance/ogles/GL/functions/functions_065_to_072.html", 
    "line": 228192, 
    "action": "test_result", 
    "expected": "OK"
}

I'm pretty certain this one is intermittent, filed #24320

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Sep 30, 2019
@gterzian
gterzian force-pushed the http-cache-condvar branch 2 times, most recently from 5da34f6 to 551e7fb Compare September 30, 2019 12:36
Comment thread components/net/http_loader.rs Resolved
@gterzian
gterzian force-pushed the http-cache-condvar branch 3 times, most recently from 56de49d to 08b3243 Compare October 2, 2019 06:16
@jdm

jdm commented Oct 4, 2019

Copy link
Copy Markdown
Member

Test written in #24370. Want to review it and see what happens with your changes?

@gterzian gterzian removed S-needs-rebase There are merge conflict errors. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Oct 5, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Oct 5, 2019
@gterzian
gterzian force-pushed the http-cache-condvar branch from b08f2f0 to ba7a157 Compare October 6, 2019 09:07
@gterzian gterzian removed the S-needs-rebase There are merge conflict errors. label Oct 6, 2019
@gterzian
gterzian force-pushed the http-cache-condvar branch from ba7a157 to 3486c1e Compare October 6, 2019 09:30
if new == 0 {
*state = HttpCacheEntryState::ReadyToConstruct;
// Notify the next thread waiting in line, if there is any.
cvar.notify_one();

@gterzian gterzian Oct 6, 2019 •

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 slipped-in one change, which is to wake-up only one thread here, and then add a call to notify the next in line at https://github.com/servo/servo/pull/24318/files#diff-aa469beb5619907dbccd88364264b9b8R1131 @asajeffrey

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Oct 7, 2019
@gterzian
gterzian force-pushed the http-cache-condvar branch from 3486c1e to edb6d74 Compare October 8, 2019 07:31
and various small improvements
@gterzian
gterzian force-pushed the http-cache-condvar branch from edb6d74 to 4f3ba70 Compare October 8, 2019 09:58
@gterzian

gterzian commented Oct 8, 2019

Copy link
Copy Markdown
Member Author

Ok this one should be good to go, it does require a r=@asajeffrey which I cannot give.

@gterzian gterzian removed the S-needs-rebase There are merge conflict errors. label Oct 8, 2019
@asajeffrey

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4f3ba70 has been approved by asajeffrey

@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 Oct 8, 2019
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4f3ba70 with merge c1401f5...

bors-servo pushed a commit that referenced this pull request Oct 8, 2019
Http cache: wait on pending stores

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

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

Copy link
Copy Markdown
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: asajeffrey
Pushing c1401f5 to master...

@bors-servo
bors-servo merged commit 4f3ba70 into servo:master Oct 8, 2019
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 8, 2019
@bors-servo bors-servo mentioned this pull request Oct 8, 2019
3 of 4 tasks
@asajeffrey

Copy link
Copy Markdown
Contributor

Yay!

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.

Concurrent requests for the same resource can result in cache misses

6 participants