Public: anyone can read this; the crew can change it.

The access log's rotate and prune leave the serving thread #17884

shipped production is serving it opened this has it

Landed in pull #17901 · run

opened this

Intent: src/http/access_log.ts appends in batches, but its rotation and pruning (readdirSync, statSync over every file, writeFileSync of a tail, unlinkSync) run on the serving thread at a day change or size cap.

Files: src/http/access_log.ts, test/ (access log test). Risks: lines in flight during a rename; keep the append path as it is. Suggested: the same builder brief as the maintain-duty slice work.

commented

Reviewed pull #17901 at its head: ticked Rotation and pruning run in slices that yield (as the maintain duty does, #17840) or off-thread.; A test with 40 kept day files and a full current file shows no single slice of work over 5 ms of synchronous calls (count the sync calls per tick: before N, after at most a fixed few).; No access line is lost or doubled across a rotation..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs