Repository navigation
CLI: write the run log file synchronously - #135
Conversation
… enqueue queue enqueue=True pickles every line onto a multiprocessing queue and hands it to a worker thread. On a 200k-line microbenchmark that is ~46 us/line vs ~14 us/line for a direct write, and per-line cost is what bounds how fast the CLI drains a large run's log records.
|
No actionable comments were generated in the recent review.
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
greens
left a comment
There was a problem hiding this comment.
This is essentially mirroring in the CLI what you did in project-chip/certification-tool-backend#403, right?
Definitely a top priority for me for the next release to iron out our logging story.
Yes @greens |
What
configure_logger_for_run()now adds the run log file sink withenqueue=False(wasTrue), plus a unit test that checks the flag. Nothing else changes: same format, same level, same file.Why
With
enqueue=Trueevery log line is pickled onto a queue and handed to a worker thread. On a 712k-line run this limits how fast the CLI drains the log records, and the CLI finished about 30 s after the backend.Evidence
Raspberry Pi 5 / 8 GB, backend
41f91e7(v2.16-develop), TC-ACE-2.1 with real-time logs ON, one run per row:time realAbout 38 s (8%) less, in line with the lag it removes. Batch mode on the same test took 449.9 s with this PR. Short runs (TC-ACE-1.3, ~53k lines) show no difference (44.7 s against 45.5 s, within the ~7 s noise), as expected.
Risk
A slow disk would block the log write instead of filling a queue; the file is local to the machine running the CLI. The large-run gain is from a single run per row.
Tests
Added
test_log_file_sink_is_not_enqueued. Not run locally; CI runs the suite.Closes #1185
Part of #1119