openclaw - 💡(How to fix) Fix [Bug]: 事件循环长时间阻塞

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

事件循环长时间阻塞(21.3 秒最大延迟)— 这是 openclaw 应用代码中的同步操作导致的,跳过模型预热可以缓解但不能根除。

Root Cause

事件循环长时间阻塞(21.3 秒最大延迟)— 这是 openclaw 应用代码中的同步操作导致的,跳过模型预热可以缓解但不能根除。

RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

事件循环长时间阻塞(21.3 秒最大延迟)— 这是 openclaw 应用代码中的同步操作导致的,跳过模型预热可以缓解但不能根除。

Steps to reproduce

根本原因 — 源代码中有 706 处同步阻塞调用:

┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────────────────┐ │ 阻塞类型 │ 数量 │ 影响 │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────────────────┤ │ readFileSync / writeFileSync │ 大量 │ 会话文件、配置文件、插件加载时的同步 I/O │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────────────────┤ │ execSync / execFileSync │ 多处 │ CLI 凭证获取、keychain 读取 │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────────────────┤ │ SQLite WAL 操作 │ 同步维护 │ memory/main.sqlite (438KB) 的读写 │ ├──────────────────────────────┼──────────────────────────────┼──────────────────────────────────────────┤ │ 会话锁竞争 │ sidecars.session-locks:511ms │ 并发会话排队等待 │ └──────────────────────────────┴──────────────────────────────┴──────────────────────────────

Expected behavior

Actual behavior

无法证实

OpenClaw version

v2026.5.19

Operating system

Winds11

Install method

No response

Model

DeepSeek

Provider / routing chain

https://platform.deepseek.com

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

从日志可以看到单次最大阻塞 21.3 秒,其中:

  • 模型预热阻塞 5.5 秒(已通过 OPENCLAW_SKIP_STARTUP_MODEL_PREWARM 跳过)
  • 会话锁操作阻塞 0.5 秒
  • 启动后维护阻塞 0.4 秒

这些同步操作发生在主线程上,当 Node.js 执行 readFileSync 读取大文件或等待磁盘 I/O 时,整个事件循环被冻结——这就是你看到的"卡住"和"突然停止执行"的根本原因。

跳过模型预热只能消除启动阶段的 5.5 秒阻塞,运行时仍有大量同步 I/O 会导致间歇性卡顿。要彻底解决需要修改 openclaw 源码,将同步 I/O 改为异步。

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING