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

Save local storage at every change and not just on shutdown #20840

Merged
merged 1 commit into from May 24, 2018

Conversation

@fabricedesre
Copy link
Contributor

fabricedesre commented May 20, 2018

Currently local storage is saved to local_data.json only at shutdown when the storage thread receives the StorageThreadMsg::Exit message. This is not reliable enough in any case, and especially problematic for a young engine like Servo. Data loss ensues...

I kept the exit message in the storage thread even if we are not doing work anymore. I can remove it if needed but it should be useful once we move to a better storage backend than a json file.


  • ./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 we don't have tests for that persistence layer.

This change is Reviewable

@highfive
Copy link

highfive commented May 20, 2018

Heads up! This PR modifies the following files:

  • @KiChjang: components/net/storage_thread.rs
@highfive
Copy link

highfive commented May 20, 2018

warning Warning warning

  • These commits modify net code, but no tests are modified. Please consider adding a test!
@fabricedesre
Copy link
Contributor Author

fabricedesre commented May 23, 2018

@Manishearth if you don't have time to look at that, please redirect the review. Thanks!

@Manishearth
Copy link
Member

Manishearth commented May 23, 2018

@Manishearth
Copy link
Member

Manishearth commented May 23, 2018

@bors-servo r+

sorry for the delay

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2018

📌 Commit 20266fa has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2018

Testing commit 20266fa with merge 0cad377...

bors-servo added a commit that referenced this pull request May 23, 2018
Save local storage at every change and not just on shutdown

<!-- Please describe your changes on the following line: -->
Currently local storage is saved to `local_data.json` only at shutdown when the storage thread receives the `StorageThreadMsg::Exit` message. This is not reliable enough in any case, and especially problematic for a young engine like Servo. Data loss ensues...

I kept the exit message in the storage thread even if we are not doing work anymore. I can remove it if needed but it should be useful once we move to a better storage backend than a json file.

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because we don't have tests for that persistence layer.

<!-- 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/20840)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2018

💔 Test failed - mac-rel-css2

@jdm
Copy link
Member

jdm commented May 23, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2018

@bors-servo
Copy link
Contributor

bors-servo commented May 23, 2018

💔 Test failed - mac-rel-css2

@jdm
Copy link
Member

jdm commented May 24, 2018

@bors-servo
Copy link
Contributor

bors-servo commented May 24, 2018

@bors-servo
Copy link
Contributor

bors-servo commented May 24, 2018

@bors-servo bors-servo merged commit 20266fa into servo:master May 24, 2018
3 of 4 checks passed
3 of 4 checks passed
Taskcluster (pull_request) TaskGroup: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
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.

None yet

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