Skip to content

fix(logging): snapshot legacy files before count scan - #905

Merged
antropos17 merged 1 commit into
masterfrom
codex/logger-rotation-reopen-20261011
Oct 11, 2026
Merged

antropos17 merged 1 commit into
masterfrom
codex/logger-rotation-reopen-20261011

Conversation

@antropos17

Copy link
Copy Markdown
Owner

Problem and behavior

On startup with several legacy daily log files, scanCount measured and opened each path only after the preceding asynchronous read. A concurrent startup flush could append to a later file or rotate its path before the scan reached it. In a real-process reproduction, the logger persisted count 23 with only 22 disk entries; a rotation case omitted legacy entries.

The scanner now captures sizes and open descriptors for all eligible files before its first asynchronous yield. It reads only the captured byte ranges from those descriptors and closes them on success and error. The change keeps the existing bounded streaming and logger cancellation semantics.

Verification

  • Real-process RED: append overcount and startup-rotation omission; GREEN: 48 focused tests across durable-count, logger and log-files.
  • Scoped formatting, ESLint and diff checks passed. The existing retention no-console warning remains.
  • Independent GPT-6.1 Sol review GO, including descriptor ownership and error-path probes, on two frozen file hashes. Rebase onto current master preserved both Git blobs.

Linux behavior was source-reviewed but not executed locally. Hosted exact-head CI is required before merge. This does not qualify the full logging/rotation acceptance task.

@antropos17
antropos17 merged commit d3c8c18 into master Oct 11, 2026
5 checks passed
@antropos17
antropos17 deleted the codex/logger-rotation-reopen-20261011 branch October 11, 2026 13:44
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