Skip to content

fix(logs): publish a live log whenever it has changed, however long an upload takes - #37

Merged
charlielye merged 1 commit into
mainfrom
cl/live-log-publish
Nov 25, 2026
Merged

charlielye merged 1 commit into
mainfrom
cl/live-log-publish

Conversation

@charlielye

Copy link
Copy Markdown
Contributor

A CI run's log (cache_log "CI run" $RUN_ID, the "CI run log id" link in the Actions step) showed only its header until the run ended, although the Actions step printed its first line, Executing: bootstrap_ec2 … (job log link), straight away.

The live publishers in cache_log, denoise and run_test_cmd uploaded a log only when it had been written in the last 5 seconds, and checked every 5 seconds plus the time an upload took. With redis, an upload is a quick SETEX, so each check came round in about 5 seconds and caught every write. A GitHub runner has no redis, so every upload goes to S3 and takes a second or more. The first upload, of the header, starts as cache_log does. A line written while it is in flight is more than 5 seconds old by the next check, so it is skipped, and a run's log gets no more writes until its jobs finish.

The three publishers now share live_publish_file in internal/source_cache. It publishes whenever the file's size or mtime differs from what it last published, so a write is always picked up by the next check, however long an upload takes.

tests/runner_log_test, whose fake S3 takes 2 seconds for an in-progress upload, gains a case for cache_log and one for denoise: a line written during an upload, then silence, must be published while the log is still open. The cache_log case fails without the fix and passes with it. The rest of tests/ passes.

…n upload takes

The live publishers in cache_log, denoise and run_test_cmd uploaded a log only
if it had been written in the last 5 seconds, checking every 5 seconds plus the
time an upload takes. On a GitHub runner, which has no redis, every upload goes
to S3 and takes a second or more, so a line written during one was more than 5
seconds old at the next check and was not published until the end. A CI run's
log showed only its header while its jobs built.

They now share live_publish_file, which publishes whenever the file's size or
mtime differs from what it last published.
@charlielye
charlielye merged commit 6bf85fb into main Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant