Skip to content

runtime: skip eviction timer when stack_pool.max_age is zero - #423

Merged
lalinsky merged 1 commit into
mainfrom
claude/issue-422-20260528-0819
May 28, 2026
Merged

lalinsky merged 1 commit into
mainfrom
claude/issue-422-20260528-0819

Conversation

@lalinsky

Copy link
Copy Markdown
Owner

When max_age is zero (age-based eviction disabled), skip both the initial timer registration in Executor.init and the rearm in stackPoolEvictionCallback, avoiding unnecessary background work on idle runtimes.

Fixes #422

When max_age is zero (age-based eviction disabled), skip both the initial
timer registration in Executor.init and the rearm in stackPoolEvictionCallback,
avoiding unnecessary background work on idle runtimes.

Fixes #422

Co-authored-by: Lukáš Lalinský <[email protected]>
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 05d1933f-d4e0-4722-8d2a-08ad194c2db5

📥 Commits

Reviewing files that changed from the base of the PR and between db1a707 and 2ee0103.

📒 Files selected for processing (1)
  • src/runtime.zig

📝 Walkthrough

Walkthrough

Executor initialization now skips registering the periodic stack-pool eviction timer when idle eviction is disabled, and the timer callback stops rearming itself under the same condition, eliminating wasted background work on runtimes with age-based eviction turned off.

Changes

Stack pool eviction timer conditional gating

Layer / File(s) Summary
Conditional timer registration and rearming
src/runtime.zig
Executor.init conditionally registers the 60-second stack pool eviction timer only when stack_pool.max_age.value > 0. The stackPoolEvictionCallback timer callback applies the same condition before re-adding itself to the event loop, preventing unnecessary periodic cleanup when max_age is zero or negative.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • lalinsky/zio#421: Introduces the stack-pool eviction timer mechanism that this PR gates on the max_age condition.

Poem

⏰ A timer ticks no more in sleep,

When max_age is zero, stack pools keep

Their steady peace, no wasted hum—

Just let the idle runtimes come. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: conditionally skipping the eviction timer registration when stack_pool.max_age is zero.
Description check ✅ Passed The description clearly explains the problem being solved and references the linked issue #422, directly relating to the code changes.
Linked Issues check ✅ Passed The code changes directly address issue #422 by skipping timer registration and rearm when max_age is zero, matching the expected behavior specified.
Out of Scope Changes check ✅ Passed All changes in src/runtime.zig are scoped to the conditional timer registration logic, directly addressing the eviction timer issue with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-422-20260528-0819

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 and usage tips.

@lalinsky
lalinsky merged commit 969f0e9 into main May 28, 2026
27 checks passed
@lalinsky
lalinsky deleted the claude/issue-422-20260528-0819 branch May 28, 2026 08:53
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.

runtime: skip eviction timer when stack_pool.max_age is zero

1 participant