feat(logger): multi-worker safe log append with deploy-time reset (#1192)#1195
Merged
zhongwen666 merged 1 commit intoJul 1, 2026
Merged
Conversation
Under multi-worker, all workers share one log file; per-process truncate-on- start races and drops lines. Add ROCK_LOGGING_APPEND so file handlers open in append mode, and reset_log_file() to truncate once in the master at deploy before workers spawn. main() clears the file once then sets append for the workers. Single-process services (rocklet, cli) keep truncate-on-start. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cf3d725 to
6b515de
Compare
xieyang0827
approved these changes
Jul 1, 2026
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.
closes #1192
Stack 2/3 — depends on #1194 (multi-worker). Merge after it. Until #1194 merges, this PR's diff also shows the multi-worker commit; GitHub auto-recomputes it down to just the logging changes once #1194 lands.
Split from the original combined proxy multi-core PR (#1147). This PR only adds multi-worker-safe logging:
ROCK_LOGGING_APPEND→ file handlers open in append mode (no per-worker truncate race).reset_log_file()truncates the shared file once in the master at deploy, before workers spawn;main()calls it then sets append for the workers.Tests:
tests/unit/test_logger_multiprocess.py.