Skip to content

Collector idle backoff fixes - #453

Merged
exodist merged 2 commits into
1.0from
collector-idle-backoff-fixes
Aug 17, 2026
Merged

exodist merged 2 commits into
1.0from
collector-idle-backoff-fixes

Conversation

@exodist

@exodist exodist commented Aug 12, 2026

Copy link
Copy Markdown
Member

No description provided.

dmitry-novozhilov and others added 2 commits August 6, 2026 16:03
…ooping

The main collector loop only slept when $count was 0, but $count is
incremented unconditionally for every active job (once for existing,
once more for not being done yet). As a result the loop never slept
while at least one test was running, polling job dir files as fast as
possible and pinning a full CPU core for the duration of the run,
regardless of concurrency settings.

Track actually-processed work (runner output lines, queue tasks, job
events) separately from the liveness counter that guards loop exit.
When an iteration processes nothing, usleep with exponential backoff
starting at 1ms and doubling up to a 100ms cap; any activity resets
the backoff to 1ms.

Note: the collector's wait_time attribute (default 0.02s, not exposed
as a CLI option and never set from within the dist) is no longer read
by this loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MdHUTVs9jHn34nXGyjyXXp
- Use wait_time as the backoff ceiling, default 0.02, with a 1ms floor,
  so worst case event latency matches what it was before the backoff.
- Reset the backoff on every path that did work, including the one that
  skips the job loop.
- Count newly discovered jobs as work.
- Move the backoff into reset_idle_wait() and idle_sleep().
- Use Time::HiRes::sleep rather than usleep, per the style guide.
- Add t/unit/Test2/Harness/Collector.t; the module had no unit test.
- Shorten the Changes entry to one sentence.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@exodist
exodist merged commit 386db80 into 1.0 Aug 17, 2026
20 of 32 checks passed
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.

2 participants