chore(工作区): 第 36 棒续作收口(A2 实例进程内面达成 · A8 改判)

- 拍板①「A」:实例一直在跑(实时视图 running@20001);进程内 /mcn/api/accounts 200 · total:5
  ⇒ A2 实例进程内面达成。纠正上一棒:其判「stopped」所据 PG dsh_instances.status 是滞后失真
- 拍板②「worker 用插件更新机制」:机制已落地且在跑(agent POST /shared-layer/pull + 定时轮询)
  真机对账快照 w-106 @23:52:11:stale:[mcn-suite] + failed:[timeout]
  ⇒ 106 自主拉取成立、该件拉取超时失败 ⇒ A8 由「未取证」改判为「机制在跑 · 该件超时」
- 平台侧问题(拉取超时 / 台账滞后)只报告不改码
- 收尾:R4 临时会话 DELETED=1 / POC_LEFT=0;未启动未停止任何实例
This commit is contained in:
admin committed 2026-09-26 00:36:34 +08:00
1 parent 6ece092782
commit df876aec90
4 files changed
+145

No files matched your search

+25
View File
@@ -933,3 +933,28 @@ try { socket.write(textFrame(text)); return true } // 🔴 返回值被丢弃
### 一句话
**群聊今天就能用(走 443 中继),端口是可选优化**;容量上连接层已能撑 10k 在线;**最该动的不是扩容,而是补扇出背压控制**。产出 ⇒ `交付物/端口与容量瓶颈评估-20260925.md`。⛔ 零代码改动、未部署、未 commit/push、未登记下一棒。
---
## 第 36 棒 · 续作(2026-09-26 00:17–00:4x)· 会话 `p36b-exec-plugin-dataline` · 用户两条拍板落地
### 拍板① =「A」⇒ A2 实例进程内面 ✅ 达成
- 🔴 **纠正上一棒**:实例**一直在跑**(实时视图 `GET /api/admin/users/<uid>/dsh/status` ⇒ `running:true`、`port:20001`);上一棒判「`stopped`」所据的是 **PG `dsh_instances.status`(滞后失真)**。⛔ 本棒**未启动/未停止**任何实例(`launch` 因 folder 口径返回 `bad_path`,无副作用)。
- **进程内读数**:`curl -s --compressed -H "Cookie: dsh_token=<实例 token>" http://127.0.0.1:20001/mcn/api/accounts` ⇒ **200** + **13,155 B** 正文 `{"ok":true,"total":5,"page":1,…,"account_name":"王微斯",…}`;无凭据访问实例根 ⇒ `401 dsh web authentication required`(证明 20001 = 该用户实例 Web)。
- R4 收尾:`DELETE FROM sessions WHERE user_agent='poc-curl2'` ⇒ `DELETED=1`、`POC_LEFT=0`。
### 拍板② =「worker 应该使用插件更新机制」(⛔ 不是给 106 开 ssh 通道)⇒ 机制已落地且在跑
- 源码实证(⛔ 未改一行):worker agent `POST /shared-layer/pull`(带 agent token,`src/worker/agent.ts:812`)+ **启动即拉一次 + 定时轮询**(`:816-819`);注释原话「**`restart dshs-worker` 就等于完成一次共享层同步,⛔ 不必再手工 scp**」;形态 = **节点主动拉(pull)+ 主节点对账告知**(`business-plugins.ts:373-377`),快照落 `<sharedRoot>/.node-sync-reports.json`。
- **真机对账快照**(309 B,`at` ⇒ 2026-09-25 23:52:11 CST,在我 23:22 `share 0.5.1` 之后):`w-106` · `authoritative:4` · `missing:[]` · **`stale:["dsh-plugin-mcn-suite"]`** · **`failed:[{"flat":"dsh-plugin-mcn-suite","error":"The operation was aborted due to timeout"}]`**。
- **判定**:**用户判断成立** —— 106 在自主拉取,不是「没通道」;但**该件拉取超时失败** ⇒ 106 仍为旧版。🔴 **平台侧参数/实现问题**(2.0 MB 包跨云拉取超时)⇒ **只报告不改码**(修复方向:调大超时 / 分块续拉 / 失败退避重试)。
- **A8 改判**:⛔「未取证」⇒ 🟡「**机制在跑 · 该件拉取超时失败(原因码具名)**」。
### 🔴 另一条平台侧发现(值得单独立项)
**`dsh_instances.status` 与实时视图不一致**(台账 `stopped`/`port:null`,实为 `running`@20001)⇒ **它影响一切「实例是否在跑」的判断**(本棒已因此差点误判)。
### 🧰 本机运维坑(本续作实测 · ⏳ 待写进 PLAYBOOK)
1. **`UID` 是 bash 只读内建变量** —— `UID=cce6…` 会报 `readonly variable` 且**赋值静默失败** ⇒ 后续 `curl http://127.0.0.1:$PORT/` 变成 `http://127.0.0.1:/`(**打到 nginx 上,返回 nginx 的 404**,极易误判成"应用没这个路由")。⇒ 变量名避开 `UID`。
2. **`.mjs` 里不能用 `require`**(须 `.cjs`);且**探针的 `catch` 分支必须 `process.exit()`** —— 否则 pg 连接不关,**进程永久挂住**(本续作实测两次 `RC=124`)⇒ 这才是此前「node 探针挂住」的真因,**不是**连接泄漏、更不是 `find` 慢。
3. **响应可能是 gzip** —— `curl` 不加 `--compressed` 时正文是二进制,`grep` 只报 `Binary file matches`、`head -c` 看起来"没输出" ⇒ 取 JSON 一律 `--compressed`。
4. **平台 Web 端口 = `127.0.0.1:3080`**(`dshs.service` MainPID 持有;另持有 `25022–25063` relay dial pool);`20001` 是**该用户实例**端口、`18081` 是 centrifugo、`20001` 之外的 `20001` 无…… ⛔ 别把实例端口当平台端口(本续作实测:对 `20001` 调平台路由得到实例的 `401 unauthorized`)。