Skip to content

SMOODEV-1527: eso-refresher keep-alive — don't unref the interval (land stranded fix)#125

Merged
brentrager merged 2 commits into
mainfrom
SMOODEV-1527-land-keepalive
Jul 8, 2026
Merged

SMOODEV-1527: eso-refresher keep-alive — don't unref the interval (land stranded fix)#125
brentrager merged 2 commits into
mainfrom
SMOODEV-1527-land-keepalive

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

The eso-refresher daemon exits 0 right after its initial mint+write: it unref()s its interval timer, and the await new Promise(() => {}) keep-alive in main() does NOT hold Node's event loop open by itself — no ref'd handles means the process exits → CrashLoopBackOff in the sidecar.

This fix was written 5 weeks ago (branch SMOODEV-1527-refresher-keepalive, 2026-06-02) and never landed — surfaced by the config-worktree hygiene sweep. Main's comment at the keep-alive site even asserts the wrong mental model ("hold the loop open explicitly"); a pending promise holds nothing.

Solution

Cherry-pick of the stranded commit: stop unref()ing the production interval (it is precisely what keeps the daemon alive; tests inject their own scheduler so they're unaffected; stop() still clearIntervals for clean shutdown) + fix the stale comment at the main() hold point.

Verification

pnpm vitest run src/eso-refresher — 6/6 green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4

brentrager and others added 2 commits July 8, 2026 17:51
The refresher exited 0 right after its initial mint+write — it unref'd the
interval timer, and the 'await new Promise(() => {})' keep-alive in main() does
NOT hold Node's event loop open on its own. Result: the sidecar CrashLoopBackOff'd
(re-minting on each restart, which masked it, but it's not a stable daemon).
Don't unref the production interval — it's what keeps the loop alive. Tests
inject their own scheduler, so they're unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 33663ae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/config Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager brentrager merged commit 4aed829 into main Jul 8, 2026
3 checks passed
@brentrager brentrager deleted the SMOODEV-1527-land-keepalive branch July 8, 2026 23:02
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