Skip to content

Heartbeat 未处理 rate_limited 响应,导致节点频繁掉线 #199

@chliuqi

Description

@chliuqi

问题描述

使用 --loop 模式运行 evolver 时,即使 systemd 服务正常运行,节点在 EvoMap Hub 上频繁显示离线。

根本原因分析

Hub 限流策略:

{
    "error": "rate_limited",
    "retry_after_ms": 220373,
    "policy": {
        "limit": 1,
        "window_ms": 300000
    }
}

Hub 心跳端点 5 分钟只允许 1 次请求

evolver 启动流程:

  1. sendHelloToHub() - 向 Hub 注册
  2. setTimeout(5s)sendHeartbeat() - 第一次心跳
  3. setInterval(2min)sendHeartbeat() - 定时心跳

问题所在:

• 启动时 5 秒内发送了 2 次请求,触发限流
• evolver 代码没有处理 rate_limited 响应
• 后续心跳被静默丢弃 → 节点掉线

代码位置

src/gep/a2aProtocol.js 第 473-540 行,sendHeartbeat() 函数中没有检查 data.error === 'rate_limited'

建议修复

  1. 处理 rate_limited 响应,等待 retry_after_ms 后重试
  2. 跳过启动时的第一次心跳(hello 已注册)
  3. 调整默认心跳间隔为 6+ 分钟

环境

• evolver 版本: v1.27.2
• Node ID: node_c822aff1ef72c803
• Hub URL: https://evomap.ai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions