Skip to content

Issue 4:实现 replica 级别的心跳监视器,补齐 SAGE 静默失败检测能力 #1488

@iliujunn

Description

@iliujunn

涉及文件: runtime.pyV1RuntimeHost)、operator_runtime/dispatch.py,可能涉及 node_runtime.py

问题描述:

SAGE 运行时的容错设计要求心跳监视器能够检测 replica 级别的静默失败,使 Dispatcher 可以在检测到失败后置备替换 replica 并恢复执行。当前 V1NodeRuntimeService 通过 gossip 协议可以感知节点级别的健康状态(节点下线),但无法检测同一节点上某个 stateful operator worker 的静默失败(例如:worker 线程 hang、operator 执行超过合理时间阈值、process_packet 长时间无响应)。

需要实现的内容:

  • WorkerHeartbeatMonitor:跟踪每个 operator replica 的最后活跃时间,支持可配置的检测间隔和超时阈值(对应 declarations.py 中已存在但未使用的 heartbeat_default_sec 字段)。
  • 超时检测触发后,应向 V1RuntimeHost 的调度路径发出 replica 失败信号,将其转换为与异常失败相同的恢复工作流(读取 recovery_policy,决定是 restart 还是 checkpoint_restore)。
  • 正常 worker 循环(Algorithm 1 风格的 dequeue → process → route 循环)在每次 dequeue 后应更新心跳时间戳,使监视器能区分"busy processing"和"hung"。
  • 心跳时间戳和超时事件应作为可观测指标暴露给 telemetry(见 Issue 12),使 V1RuntimeInspector 能查询每个 replica 的最后活跃时间。

任务目标: 让 SAGE 运行时能够检测 operator 级别的静默失败,而不只依赖异常信号,从而使心跳触发的恢复路径与异常触发的恢复路径统一进入同一套容错机制。

完成标准: WorkerHeartbeatMonitor 能检测 operator replica 级别的静默超时,超时事件触发与异常失败相同的恢复工作流,心跳状态在 telemetry 中可查询。


父 Issue: #1484

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions