Skip to content

【BUG】link runtime: crash 自动重启被旧 start 的 catch 毒化 stopping,健康进程崩溃后不再自愈 #187

Description

@CavinHuang

来源

PR #186 修复 #127 时的 subagent 审查发现(存量交错行为,非该 PR 引入,该 PR 客观收窄了伤害面)。

位置

apps/desktop/src/link-runtime-supervisor.ts start() 的 catch 分支 + exit handler 的 restartTimer。

问题

健康等待期内子进程崩溃时的交错:

  1. exit handler 触发:child=null、publish offline、调度 restartTimer(1-2s 后再 start)
  2. timer 触发 start#2 → 重新 fork 进程refactor(agent): make capability routing demand-driven #2 → 进程refactor(agent): make capability routing demand-driven #2 上线
  3. 旧 start#1 的 waitForLinkHealth 仍在轮询同一端口,拿到新进程refactor(agent): make capability routing demand-driven #2 的健康响应child !== running → throw link_runtime_exited_during_start
  4. catch#1:isCurrent() 仍 true(start 不 bump operationGeneration,两代 start 共享 generation)→ stopping = true 落在健康的 running2 头上,且 publish("crashed") 可能盖掉 start#2 的 online(publish 非 online 分支还会清 currentCredentials,拖累 diagnose)

确定性后果:running2 之后真崩溃时,exit handler 走 stopping 分支 → 只 publish offline、不计数、不自动重启,自愈链路被毒化。

建议

关联

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions