docs: record worker concurrency rollout
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
- P6.12 All-user Long-running Gray: 已完成,生产已默认对所有用户开启 H5 code-run 灰度,external worker running,普通测试用户真实 code-run 已成功生成 MindSpace 产物。
|
||||
- P6.13 Agent Run Auto-pause Guard: 已完成,新增 `agent-run-guard.mjs` 和 LaunchAgent,按失败数/队列积压/running 超时自动关闭 code-run gate 并停 worker。
|
||||
- P6.15 H5 Code-run Validation Metadata: 已完成,H5 code-run 自动声明 `.memind/agent-runs/<requestId>.json` receipt 校验,生产已恢复 `MEMIND_AGENT_CODE_RUNS_REQUIRE_VALIDATION=1` 并通过普通测试用户真实路径。
|
||||
- P6.17 Controlled Worker Concurrency Canary: 已完成,external worker 短窗口提升到并发 2,两条真实 code-run 同时 running 并全部通过 receipt validation。
|
||||
- P6.18 Concurrency Rollout Policy: 已完成,生产 worker 和 Portal runtime/status 已对齐到并发 2,worker KeepAlive 保持开启,保留回滚备份。
|
||||
- P5.15 Active Stream TTL Reconcile: 已按用户要求跳过,暂不做报表/定时 reconcile。
|
||||
- P5 Worker Pool 运维化: 已完成第一步,Redis Router 支持 worker drain。
|
||||
- P5.9 First-token Latency EWMA: 已完成,StreamController 会把首个 SSE chunk 延迟写入 Redis,SLO 报告已展示。
|
||||
@@ -2642,6 +2644,98 @@ runtime/status:
|
||||
- `/Users/john/Project/memind_backups/20260702-114335-p615-validation-metadata`
|
||||
- worker KeepAlive 运维补强备份: `/Users/john/Project/memind_backups/20260702-115330-worker-keepalive`
|
||||
|
||||
### 2026-07-02 P6.17 Controlled Worker Concurrency Canary
|
||||
|
||||
目标:
|
||||
|
||||
- 在 required validation 和 auto-pause guard 已稳定后,短窗口验证 external worker 并发 2。
|
||||
- 不扩大 code-run gate,不改用户 allowlist,不改 task type allowlist。
|
||||
- 真实 canary 使用两个新测试用户,避免同一 MindSpace/git 工作目录互相锁住。
|
||||
|
||||
生产变更:
|
||||
|
||||
- 备份:
|
||||
- `/Users/john/Project/memind_backups/20260702-120520-p617-concurrency-canary`
|
||||
- worker LaunchAgent 临时提升:
|
||||
- `MEMIND_AGENT_RUN_WORKER_BATCH_SIZE=2`
|
||||
- `MEMIND_AGENT_RUN_QUEUE_CONCURRENCY=2`
|
||||
- `--limit 2`
|
||||
- `KeepAlive=true`
|
||||
|
||||
验证:
|
||||
|
||||
- 两条真实 code-run 同时进入 running:
|
||||
- run `d064c8c0-b061-4df7-8c9b-5dfa315271ea`
|
||||
- user `916f1fe6-e9c8-44b5-9faa-2fc1bf146ab9`
|
||||
- request `p617-concurrency-20260702040600-1`
|
||||
- started `1782965163186`
|
||||
- completed `1782965180346`
|
||||
- status `succeeded`, attempts `1`
|
||||
- run `64717bcc-4065-4947-a0d3-a706f3b62640`
|
||||
- user `07f29934-8cf8-408a-af92-3c4276e579c8`
|
||||
- request `p617-concurrency-20260702040600-2`
|
||||
- started `1782965163135`
|
||||
- completed `1782965186566`
|
||||
- status `succeeded`, attempts `1`
|
||||
- 两条 run 都写入:
|
||||
- `tool_gateway_dispatch`
|
||||
- `tool_gateway_result`
|
||||
- `tool_gateway_validation`
|
||||
- `succeeded`
|
||||
- MindSpace 验证:
|
||||
- 两个 receipt JSON 均包含 requestId。
|
||||
- 两个 `public/p617-concurrency-*.html` 均包含目标 marker。
|
||||
- worker log:
|
||||
- `limit=2`
|
||||
- `maxConcurrentRuns=2`
|
||||
- `dispatched=2`
|
||||
- P6.17 后复查:
|
||||
- worker running
|
||||
- queue empty
|
||||
- guard `shouldPause=false`
|
||||
- SLO `ok=true`, `failures=[]`
|
||||
|
||||
### 2026-07-02 P6.18 Concurrency Rollout Policy
|
||||
|
||||
目标:
|
||||
|
||||
- 将 P6.17 的并发 2 从短窗口 canary 固化为当前 all-user gray 的可运营策略。
|
||||
- 让 worker LaunchAgent、Portal `.env` 和 runtime/status 对齐,避免状态面显示并发 1 但实际 worker 并发 2。
|
||||
|
||||
生产配置:
|
||||
|
||||
- `/Users/john/Project/Memind/.env`:
|
||||
- `MEMIND_AGENT_RUN_QUEUE_CONCURRENCY=2`
|
||||
- `MEMIND_AGENT_RUN_WORKER_BATCH_SIZE=2`
|
||||
- worker LaunchAgent:
|
||||
- `MEMIND_AGENT_RUN_QUEUE_CONCURRENCY=2`
|
||||
- `MEMIND_AGENT_RUN_WORKER_BATCH_SIZE=2`
|
||||
- `--limit 2`
|
||||
- `KeepAlive=true`
|
||||
|
||||
验证:
|
||||
|
||||
- `https://mm.tkmind.cn/api/status` 返回 `ok`。
|
||||
- `/api/runtime/status`:
|
||||
- `codeRunPolicy.requireValidation=true`
|
||||
- `toolRuntime.queue.maxConcurrentRuns=2`
|
||||
- `toolRuntime.queue.statusCounts={}`
|
||||
- worker check:
|
||||
- running `true`
|
||||
- process args include `--limit 2`
|
||||
- guard dry-run:
|
||||
- `ok=true`
|
||||
- `shouldPause=false`
|
||||
- queue empty
|
||||
- SLO:
|
||||
- `ok=true`
|
||||
- `failures=[]`
|
||||
|
||||
观察:
|
||||
|
||||
- Portal 在一次重启窗口中出现 `read EADDRNOTAVAIL` 并由 LaunchAgent 自动拉起,随后 `/api/status` 和 `/api/runtime/status` 恢复 `ok`。
|
||||
- 后续建议优先做 running/stuck recovery 与 DB/session auth 异常不致命化,避免瞬时 DB/socket 错误扩大为进程退出。
|
||||
|
||||
## 回滚策略
|
||||
|
||||
- P0: 修改前保留 `server.mjs` 备份;如启动失败,恢复备份并 `launchctl kickstart` Portal。
|
||||
|
||||
Reference in New Issue
Block a user