fix(daemon): stop dev-mode restarts from 0.0.0.0 connect + watchMeta retry spin#1179
fix(daemon): stop dev-mode restarts from 0.0.0.0 connect + watchMeta retry spin#1179vibegui wants to merge 1 commit into
Conversation
The Apr 17 revert of #1170 (#1173) bundled together two unrelated changes and re-broke the worker connect hostname. Restore only the surgically-isolated hostname half (0.0.0.0 -> 127.0.0.1) and leave the proxy-client decision alone. Also: - Add a 1s backoff to watchMeta's catch path. Without it, a fast- failing worker fetch (connection refused mid-restart, etc.) tight- loops the long-poll, pegging CPU and flooding stderr until a supervisor kills the daemon. - Log UNSTABLE_WORKER_RESPAWN_INTERVAL_MS at startup so scheduled restarts can be ruled in/out at a glance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tagging OptionsShould a new tag be published when this PR is merged?
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThree targeted improvements: adds runtime logging for worker respawn interval configuration visibility, implements error backoff throttling in metadata watching retry loop to reduce CPU and stderr usage, and corrects proxy connect address from bind-wildcard to loopback on non-Windows systems. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
Lead reported that the dev experience for deco sites has degraded over the last few weeks with intermittent restarts. After investigating I found two issues that compound to produce that symptom:
daemon/workers/denoRun.ts:85— PR Revert "fix(daemon): remove Deno HTTP proxy client from worker fetch" #1173 (Apr 17) wholesale-reverted fix(daemon): remove Deno HTTP proxy client from worker fetch #1170, which silently brought back `0.0.0.0` as the worker connect hostname. `0.0.0.0` is a bind wildcard, not a valid outbound connect target on macOS/Linux — connections through it are platform/Deno-version-dependent and flake. This PR restores only the hostname half of fix(daemon): remove Deno HTTP proxy client from worker fetch #1170 (`127.0.0.1`) and leaves the proxy-client decision alone, since that was reverted for a separate legitimate Vite asset-routing reason.daemon/meta.ts— `watchMeta`'s long-poll loop has a catch path that just logs and continues, with no backoff. When the worker fetch fails fast (connection refused mid-restart, the hostname flake above, etc.) it becomes a tight CPU-pegging spin that floods stderr until a process supervisor kills the daemon — i.e. the "restarts". This PR adds a 1s backoff, matching the pattern already used on the 304 path.daemon/main.ts— added a one-line startup log of `UNSTABLE_WORKER_RESPAWN_INTERVAL_MS` so scheduled restarts (`Deno.exit(1)` on a timer) can be ruled in/out at a glance.15 lines changed across 3 files.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Stops intermittent dev-mode restarts by connecting workers to
127.0.0.1(not0.0.0.0) and adding a 1s backoff to prevent tight retry spins. Also logsUNSTABLE_WORKER_RESPAWN_INTERVAL_MSat startup for quick diagnosis.Bug Fixes
127.0.0.1for worker outbound connections on non-Windows (0.0.0.0->127.0.0.1).watchMetaerror path to avoid CPU spin and stderr flood during worker restarts.New Features
UNSTABLE_WORKER_RESPAWN_INTERVAL_MSon daemon startup to help rule out scheduled restarts.Written for commit 383efee. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Features
Bug Fixes