Repository navigation
fix(logs): publish a live log whenever it has changed, however long an upload takes - #37
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,denoiseandrun_test_cmduploaded 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 quickSETEX, 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 ascache_logdoes. 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_fileininternal/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 forcache_logand one fordenoise: a line written during an upload, then silence, must be published while the log is still open. Thecache_logcase fails without the fix and passes with it. The rest oftests/passes.