diff --git a/docs/development/agent-feature-maintenance.md b/docs/development/agent-feature-maintenance.md index 9eaa670c..ad4a9d1a 100644 --- a/docs/development/agent-feature-maintenance.md +++ b/docs/development/agent-feature-maintenance.md @@ -133,6 +133,9 @@ write 也必须服从当前实现与测试。修改前先确认代码中的常 并发数、队列长度或容量数字替用户决定吞吐。仍禁止静默丢事件、无限重启、按项目预建 服务、为每个调用新增 scheduler,或用串行夹具掩盖真实负载。 +Worker 发生故障时可以进入已有退避和恢复流程;这不应被伪装成负载上限。正常排队的 +解析、存储和 Host 工作不能因为一个未经测量的队列数字直接返回 busy。 + ## 测试与真实验证 单元测试用于确定字节边界、事务回滚、顺序、归属、取消竞态、失败清理和重试。行为改动 diff --git a/docs/quality/storage-upgrade-implementation-2026-10-05.md b/docs/quality/storage-upgrade-implementation-2026-10-05.md index cf470b0f..6edbb985 100644 --- a/docs/quality/storage-upgrade-implementation-2026-10-05.md +++ b/docs/quality/storage-upgrade-implementation-2026-10-05.md @@ -51,7 +51,8 @@ Agent 旧包/远程 staging 的失败清理、项目删除附件回收、诊 分别报告界面延迟、Main 阻塞、存储等待/提交、吞吐、取消、内存和文件增长,禁止将单测通过替代性能结论。 实测超预算、未覆盖平台或外部环境阻断均保留为未满足项,不能宣称全部已解决。 -当前记录确认 S01-S07 已有生产组合和定向证据;完整架构验收、平台包验证和 C01-C07/A01-A10 仍未完成。 +当前记录确认 S01-S07 已有生产组合和定向证据;解析 Worker 的无依据队列拒绝已移除。 +完整架构验收、平台包验证和 C01-C07/A01-A10 仍未完成。 ## 2026-10-05 Portable 真实副本验证 diff --git a/src/main/document-parse-client.ts b/src/main/document-parse-client.ts index 263c972a..2d40b547 100644 --- a/src/main/document-parse-client.ts +++ b/src/main/document-parse-client.ts @@ -47,7 +47,6 @@ type Task = { cleanup: () => void } -const MAX_QUEUED = 32 const RESTART_BACKOFF_MS = 30_000 type PdfExceptionConstructor = new (message: string) => Error @@ -116,10 +115,9 @@ export class DocumentParseWorkerClient { private readonly now: () => number = Date.now ) {} - /** False while closed, backing off after a crash, or when the queue is full. */ + /** False while closed or backing off after a worker failure. */ get available(): boolean { - return !this.closed && this.now() >= this.disabledUntil && - this.queue.length < MAX_QUEUED + return !this.closed && this.now() >= this.disabledUntil } get pendingCount(): number { @@ -137,9 +135,6 @@ export class DocumentParseWorkerClient { if (this.now() < this.disabledUntil) { return Promise.reject(new DocumentParseWorkerUnavailableError('Document parse worker is backing off')) } - if (this.queue.length >= MAX_QUEUED) { - return Promise.reject(new DocumentParseWorkerUnavailableError('Document parse worker is busy')) - } return new Promise((resolve, reject) => { const task: Task = { id: ++this.nextId,