web-server icon indicating copy to clipboard operation
web-server copied to clipboard

`make-dir-store` is not atomic

Open LiberalArtist opened this issue 1 year ago • 0 comments

While looking at a Discourse thread, I noticed that make-dir-store uses (with-output-to-file #:exists 'replace ...):

https://github.com/racket/web-server/blob/87a1e58a9b92c621f7d96c76de1da39587f04140/web-server-lib/web-server/stuffers/store.rkt#L9-L13

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.

LiberalArtist avatar May 11 '24 00:05 LiberalArtist