fix(backend): give each report file a name of its own (closes #61)
check / check (push) Successful in 58s
check / check (push) Successful in 58s
Report files were named by a millisecond timestamp and created with O_EXCL, so two flushes in the same millisecond, such as a flush for size and the final flush at shutdown, got the same name and the second failed, losing its reports. Each name now carries a number after the timestamp that counts the files written since the server started, so names still sort by time and never repeat. The new test flushes pairs until one falls within one millisecond; the 1 ms pauses earlier tests used to dodge the collision are gone. Model: opus-5-5
This commit is contained in:
+6
-3
@@ -102,9 +102,12 @@ which `netwatch` owns.
|
||||
|
||||
### Report storage
|
||||
|
||||
Reports are written as `reports-<timestamp>.jsonl.zst` files in `DATA_DIR`.
|
||||
Each file contains one JSON object per line, compressed with zstd. Files are
|
||||
created with `O_EXCL` to prevent overwrites.
|
||||
Reports are written as `reports-<timestamp>-<number>.jsonl.zst` files in
|
||||
`DATA_DIR`. The timestamp is in UTC to the millisecond, so the names sort by
|
||||
time; the number counts the files the server has written since it started, so
|
||||
two files written in the same millisecond still get different names. Each file
|
||||
contains one JSON object per line, compressed with zstd. Files are created with
|
||||
`O_EXCL` to prevent overwrites.
|
||||
|
||||
### Report limits
|
||||
|
||||
|
||||
Reference in New Issue
Block a user