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

Http cache: wait on pending stores #24318

Merged
merged 1 commit into from Oct 8, 2019

Conversation

gterzian
Copy link
Member

@gterzian gterzian commented Sep 29, 2019

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

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

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

@bors-servo try=wpt

@bors-servo
Copy link
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
Member Author

@bors-servo try=wpt

@bors-servo
Copy link
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
Contributor

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

@gterzian
Copy link
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
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
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
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
@gterzian gterzian force-pushed the http-cache-condvar branch 3 times, most recently from 56de49d to 08b3243 Compare October 2, 2019 06:16
@jdm
Copy link
Member

jdm commented Oct 4, 2019

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
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 removed the S-needs-rebase There are merge conflict errors. label Oct 6, 2019
if new == 0 {
*state = HttpCacheEntryState::ReadyToConstruct;
// Notify the next thread waiting in line, if there is any.
cvar.notify_one();
Copy link
Member Author

@gterzian gterzian Oct 6, 2019

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
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
and various small improvements
@gterzian
Copy link
Member Author

gterzian commented Oct 8, 2019

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
Member

@bors-servo r+

@bors-servo
Copy link
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
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
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
@asajeffrey
Copy link
Member

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