Repository navigation
fix(base): Publish command output at most every two seconds - #614
Open
balamurali27 wants to merge 4 commits into
Open
balamurali27 wants to merge 4 commits into
balamurali27 wants to merge 4 commits into
Conversation
parse_output sent the whole output so far to Redis on every line and every progress-bar update. Redis logs each write to its AOF in full, so the AOF grows with the square of the output. On f1 the AOF is 384 MB for 1 MB of data. On a server with the agent on a small root disk, this filled the disk and Redis refused writes with MISCONF. Press polls job output every five seconds (poll_pending_jobs), so two seconds keeps the output it shows fresh. The final output is still published after the loop and by log(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VTnJ7zBU5AidQfFREeTExQ
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
|
RQ pickles the object that a job method is bound to. A closure cannot be pickled, so an object that stores the throttle as an attribute could not be enqueued. The image builders need this in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VTnJ7zBU5AidQfFREeTExQ
ImageBuilder and PatchImageBuilder each had a copy of the same throttle. Both now use Throttle from base. Their output is published every two seconds instead of every second, on the monotonic clock instead of the wall clock, and the first update goes out at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VTnJ7zBU5AidQfFREeTExQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017JQShbx4JgSX4qHARVx3ty
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.
parse_outputsent the whole output so far to Redis on every line and on every\rprogress-bar update. Redis writes each of these commands to its AOF in full, so the AOF grows with the square of the output. On a test server the AOF is 384 MB, but the data in Redis is only 1 MB.On a server where the agent is on a small root disk, this filled the disk. Redis then refused all writes with
MISCONF Errors writing to the AOF file: No space left on device, and a New Site from Backup job failed inupdate_redis.This change publishes command output at most every two seconds. The final output is still published after the loop and by
log().ImageBuilderandPatchImageBuilderhad two copies of their own one-second throttle. They now use the sameThrottlefrombase.py.Throttleis a class, not a closure, because RQ pickles the builder object when it enqueuesRun Remote BuilderandRun Patch Build. A closure attribute makes that pickle fail. A test checks this.Blast radius
parse_outputis used byexecute(), so this covers site, bench, server, backup and restore steps. Only the live output in Redis changes. Step status, return values,jobs.sqlite3data and callbacks do not change. The final output is published the same way as before.poll_pending_jobs), so the output shown is at most about seven seconds old, instead of about five.cancel_and_retry_bench_job_if_requiredlooks forTLS handshake timeoutandRetrying in 10 secondsin the live output of the running Initialize Bench step. Because of the gap above, Press can see these lines later. In the worst case, when Docker goes silent right after the line, Press sees it only when the step ends.docker_output_parsers.py) get updates less often./jobsAPI format.An AOF that is already large does not shrink by itself. Run
BGREWRITEAOFonce on affected servers.🤖 Generated with Claude Code
https://claude.ai/code/session_01VTnJ7zBU5AidQfFREeTExQ