`make-dir-store` is not atomic
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 99
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
While looking at a Discourse thread, I noticed that make-dir-store uses (with-output-to-file #:exists 'replace ...):
It seems like it would be better to use call-with-atomic-output-file here: if somehow you ended up with a partially-written file, it seems like it would be very painful to debug.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with web-server-lib/web-server/stuffers/store.rkt, especially make-dir-store at the linked lines, and read how it currently writes the store file. Compare that path with call-with-atomic-output-file and verify that a write leaves either the previous complete file or a new complete file, not a partially written one.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100