[rushd][WS3] Daemon lifecycle, reload & warm-set
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- nodejs, typescript
- 领域
- build-system, tooling
调研方向
Start with rush-client-core and the host readiness signaling described in the scope, then read dependencies #5895, #5896, and #5897. Trace the daemon lifecycle, reload, restart, idle-shutdown, crash-recovery, and warm-set requirements against the acceptance criteria. Done means lifecycle, concurrency, and eviction tests cover the listed invariants and CI is green.
由索引模型根据 Issue 内容生成。
描述
Own the daemon's whole lifecycle and memory footprint: client auto-start, fingerprint-driven reload tiers, install/update self-restart with socket handoff, version-mismatch restart, idle auto-shutdown, and stale-socket/crash recovery — plus best-effort warm-set management (LRU idle eviction under a memory budget, telemetry-weighted warm selection, and its config surface) that never affects build correctness.
Depends on: #5895; #5896; #5897
Scope
- Client auto-start. In
rush-client-core, paired with host readiness signaling: a start-lock to avoid a thundering herd, a detached spawn that survives the starting client, awaiting the ready signal, and backoff on failure. - Reload tiers. After each
EXCLUSIVEcommand, compute an inputs fingerprint and pick a tier — 0 hot (no reload), 1 soft reload (re-read config/graph), or 2 hard restart (new process). - install/update self-restart. Run the mutation, send the requesting client its exit code first, then drain, kill runners, spawn a successor, and hand off the socket (clients connecting during handoff transparently retry).
- Version-mismatch restart. Trigger a Tier-2 restart on version skew (client expects Y, daemon runs X) and retry the request.
- Idle shutdown & crash recovery. Shut down after an idle timeout (active runners inhibit shutdown); detect a stale socket/PID from a crashed daemon and auto-start a replacement.
- Warm-set eviction. Auto-evict idle operations LRU under a budget (
closeRunnersAsync(cold)+ watcher teardown + record drop), never evicting active-and-subscribed operations. - Telemetry-weighted warming. Warm-select operations from the graph's per-op telemetry (
score = (timeSaved × frequency) / residentMemory), sharing one ranking with eviction so warming and eviction never disagree. - Warm-set config. Expose
warmIdleTimeoutSeconds,warmMemoryBudgetMB,warmSetMaxProjects, andautoWarmByTelemetry; all warm-set behavior is best-effort and never correctness-affecting.
Acceptance criteria
- N concurrent first-invocations start exactly one daemon (start-lock holds under a race); the daemon spawns detached and survives the starting client; start failures back off with an actionable error (falling back to in-process where applicable).
- Known input deltas map to the expected reload tier (no change → 0, config change → 1, version/engine change → 2); the fingerprint is stable for unchanged inputs and changes when relevant inputs change.
- On install/update the requesting client receives its exit code before the restart begins, the successor takes over the socket with no dropped client (in-flight connections retry and succeed), and the warm graph is rebuilt against post-install/update state.
- A forced version skew triggers a Tier-2 restart into the expected version and the client's request then succeeds, with no orphaned old-version daemon left behind.
- The daemon exits after the configured idle timeout (an in-flight runner prevents shutdown until it finishes); a stale socket/PID is detected and a replacement auto-starts on the next request.
- Eviction keeps resident memory under the configured budget by dropping LRU cold operations and never evicts active-and-subscribed operations (invariant asserted under load).
- A single deterministic ranking drives both warm selection and eviction, preferentially warming/retaining higher-value operations (high
timeSaved × frequency, low memory); warm-set behavior is best-effort and correctness is unaffected when telemetry is absent. - All four warm-set knobs are schema-validated with documented defaults, reject invalid/out-of-range values, and take effect at runtime; changing any knob only affects footprint/latency, never build correctness.
- Lifecycle, concurrency, and eviction paths are covered by tests; tests green in CI.
Part of #5894.
- 主要语言
- TypeScript
- 星标
- 6.5k
- 派生
- 710
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 48
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/rushstack 的其他 Issue
-
[rush] Upgrade the pnpm-sync-lib dependency to 0.3.5.可能已有人在做 @martinnaj 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/rushstack#5971 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
microsoft/rushstack#5902 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/rushstack#5839 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/rushstack#5683 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 45/100
维护者通常 1 天内回复
查看 microsoft/rushstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:session-state issue-rating: 🌊 off-meta tidepool P2
难度 2/5 1-3 小时 新手友好度 74/100
openclaw/openclaw#165245 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
agent-canvas bug priority:low ready-for-dev
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
🐛 bug
难度 2/5 1-3 小时 新手友好度 61/100
spicetify/marketplace#1262 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 68/100
维护者通常 1 天内回复