Skip to content

Fill freed capacity in the same tracking cycle - #118

Merged
yoonspark merged 1 commit into
mainfrom
fix/stage-on-freed-capacity
Aug 17, 2026
Merged

Fill freed capacity in the same tracking cycle#118
yoonspark merged 1 commit into
mainfrom
fix/stage-on-freed-capacity

Conversation

@yoonspark

Copy link
Copy Markdown
Collaborator

Summary

A finished file's slot sat empty until the next cycle, and the idle-clock message only appeared if a file happened to complete on that exact cycle. Both come from the ordering of steps in _run_tracking_cycle.

  • Stage new files after failed and processed files are handled, so a freed slot is refilled immediately.
  • Check inactivity last, so a cycle that just picked up new work is not counted as idle.
  • Log "starting idle time count" from _check_inactivity whenever work runs out, guarded by a flag so it fires once per quiet spell.
  • Add tests for same-cycle refill and for the idle message firing once per settling.

Files that finished processing released their capacity only after
`_stage_new_files` had already run, so a waiting file sat idle for a
full cycle before taking the freed slot.

- Move `_stage_new_files` after the failure and completion handlers, and
  keep `_check_inactivity` last so a cycle that just staged work is not
  counted as idle
- Move the idle-clock announcement into `_check_inactivity`, where the
  settled state is now final, and guard it so it logs once per settling
@yoonspark yoonspark added the bug Something isn't working label Aug 17, 2026
@yoonspark
yoonspark merged commit b47c00e into main Aug 17, 2026
8 checks passed
@yoonspark
yoonspark deleted the fix/stage-on-freed-capacity branch August 17, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant