[错误] 请求日志记录工作者没有资源限制,并将 OOM 批次重新排入队列的头部,导致日志记录默默终止,且在重启后无法恢复。

作者: Maziar123创建于 2026年9月17日更新于 2026年9月17日

1 — the log workers have no heap cap. packages/core/src/observability/request-log-runtime.ts:708 (writer) and :848 (query):

typescript
const worker = new Worker(this.options.workerFile, {
  workerData: {
    dbFile: this.options.dbFile,
    mode: "writer",
    rawTraceSpoolDir: this.options.rawTraceSpoolDir
  }
});

No resourceLimits. Batches are structured-cloned into the worker (batchMaxBytes 4 MB / batchMaxItems 50, queueMaxBytes 128 MB), and the worker also holds SQLite bind buffers for them.

内容来源: musistudio/claude-code-router