p2panda / aquadoggo

Node for the p2panda network handling validation, storage, aggregation and replication
GNU Affero General Public License v3.0
69 stars 5 forks source link

Use `write_all` when writing blob data to file system #587

Closed sandreae closed 10 months ago

sandreae commented 10 months ago

We should use write_all instead of write when writing blob data to the filesystem as the latter only represents a "single attempt" to write a buffer to a file, whereas the former "continuously calls [write] until there is no more data to be written" or an error occurs. In using the later we were sometimes silently failing to write all data to the file system.

Closes #586

πŸ“‹ Checklist

adzialocha commented 10 months ago

Really good to know ✨✊🏻

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (4809fab) 92.67% compared to head (9ca7317) 92.68%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #587 +/- ## ========================================== + Coverage 92.67% 92.68% +0.01% ========================================== Files 106 106 Lines 18384 18405 +21 ========================================== + Hits 17037 17059 +22 + Misses 1347 1346 -1 ``` | [Files](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda) | Coverage Ξ” | | |---|---|---| | [aquadoggo/src/db/stores/document.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9kYi9zdG9yZXMvZG9jdW1lbnQucnM=) | `98.76% <100.00%> (-0.10%)` | :arrow_down: | | [aquadoggo/src/db/stores/operation.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9kYi9zdG9yZXMvb3BlcmF0aW9uLnJz) | `89.74% <100.00%> (+0.11%)` | :arrow_up: | | [aquadoggo/src/materializer/tasks/blob.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9tYXRlcmlhbGl6ZXIvdGFza3MvYmxvYi5ycw==) | `87.09% <100.00%> (+2.84%)` | :arrow_up: | | [aquadoggo/src/materializer/tasks/reduce.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy9tYXRlcmlhbGl6ZXIvdGFza3MvcmVkdWNlLnJz) | `94.84% <100.00%> (-0.09%)` | :arrow_down: | | [aquadoggo/src/test\_utils/node.rs](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda#diff-YXF1YWRvZ2dvL3NyYy90ZXN0X3V0aWxzL25vZGUucnM=) | `95.00% <100.00%> (ΓΈ)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/p2panda/aquadoggo/pull/587/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=p2panda)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.