Hourly capabilities/discovery refresh rewrites appdata files even when unchanged (wakes sleeping disks)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with lib/Service/CachedRequestService.php, especially the fetch() method at the line cited in the issue, and inspect how it reads and writes cached response files. Check the existing tests for CachedRequestService and add coverage for identical and changed responses. Done means unchanged content no longer triggers a file write while the distributed cache still refreshes hourly.
Written by the indexing model from the issue text.
Description
Describe the bug
ObtainCapabilities runs every hour and calls fetch() on CapabilitiesService and DiscoveryService. CachedRequestService::fetch() always rewrites appdata_*/richdocuments/remoteData/capabilities and discovery, even when the response is identical to the stored file. In practice the content almost never changes.
On a server where the data directory lives on hard disks that spin down when idle, this hourly write wakes the disks every time. I traced it with fatrace for one night: the disks were woken within a minute of each of these writes (roughly every 65 minutes), and nothing else touched the pool between scheduled backups.
Expected behavior
Only write the file when the content differs from what is already stored (for example: compare with getContent() of the existing file, or keep a hash in the distributed cache, and skip newFile() when unchanged). The distributed cache can still be refreshed every hour.
Setup
- richdocuments 11.1.2 (same code on
main,lib/Service/CachedRequestService.phpline 86) - Nextcloud AIO with the built-in Collabora container
- Data directory on a ZFS pool of HDDs with a spindown timer
Workaround for now: put appdata_*/richdocuments/remoteData on an SSD with a separate mount.
- Dominant language
- JavaScript
- Stars
- 459
- Forks
- 150
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 103
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/richdocuments
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nextcloud/richdocuments#6194 ·
Maintainers usually reply within 1 day
-
bug design papercut
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nextcloud/richdocuments#6124 · 1 comment ·
Maintainers usually reply within 1 day
-
Slide deck generation fails with TypeError when the model omits "content"; slides always in EnglishOpen
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
nextcloud/richdocuments#6120 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
nextcloud/richdocuments#6119 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nextcloud/richdocuments#5663 ·
Maintainers usually reply within 1 day
All issues in nextcloud/richdocuments
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
srikanth235/centraid#1155 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/monaco-editor#5563 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day