Skip to content

SLOP-238: stop archive-cron-logs from looping forever when nothing is archivable - #16

Open
tosfos wants to merge 2 commits into
masterfrom
SLOP-238-archive-loop-no-progress
Open

SLOP-238: stop archive-cron-logs from looping forever when nothing is archivable#16
tosfos wants to merge 2 commits into
masterfrom
SLOP-238-archive-loop-no-progress

Conversation

@tosfos

@tosfos tosfos commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • archive-cron-logs.sh loops until group_logs_by_time returns BREAK, but when eligible logs are at or below target_count (including an empty directory) no BREAK is ever produced and the script spins forever, wedging the scheduled archiving job (the image's own example schedules archive-cron-logs 100 monthly).
  • Reproduced pre-fix: exit 124 under timeout 15 for 5-file, empty-dir, and exactly-20-files scenarios; repeated ERROR: Unexpected state in group_logs_by_time output.
  • The driver now stops when a pass produces no file list — the state cannot change on a re-run. Post-fix all three scenarios exit 0 immediately; the bulk-archive path still archives normally.

Jira: SLOP-238

Test plan

  • Empty dir: exits 0 with a clear message (was: infinite loop)
  • n < target_count: exits 0 (was: infinite loop)
  • n == target_count: exits 0 (was: infinite loop)
  • 33 logs / target 20 bulk scenario: unchanged behavior, archives created as before
  • shellcheck + bash -n clean

Ike Hecht added 2 commits August 22, 2026 05:45
… archivable

When eligible logs are at or below target_count (including an empty
directory), group_logs_by_time never reaches its end-window BREAK and
returns an error result; the driver looped on the unchanged state
forever, wedging the scheduled archiving job. Detect a pass that
produced no file list and exit the loop instead of retrying.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 58b54370-2a71-4b2b-acf8-78df88cdf7ba


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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