后台常驻实例会留下不退出副本(inbox --no-open)

Aperta
#3,350 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

Start with the plannotator inbox startup path and the plannotator inbox status reporting code, since the issue is about instance lifecycle and what status lists. Reproduce by launching several inbox --no-open processes at once, then check whether each one honours PLANNOTATOR_PORT and PLANNOTATOR_DATA_DIR. Done means orphaned background instances either exit or are reported by status, with a test covering the concurrent-start case. The cause is still unverified, so confirm it before choosing between a file lock and idle exit.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

环境:macOS 27.0.1 (26A434);Plannotator 0.28.64;服务运行在 127.0.0.1:65176

现象:plannotator inbox status 报告只有一份在跑(pid 55438,占 634 MB)。但同一时刻机器上还有 3 个 plannotator inbox --no-open 进程:

pid 内存 启动时间 父进程
13200 121 MB 00:34 1
88476 119 MB 00:32 1
78796 118 MB 01:02 1

三个的命令行和正在服务的那份完全相同,父进程都已经是 1,也就是说拉起它们的进程早就退了,它们自己没退。它们也不出现在 status 的输出里。

复现尝试没成功:我试着在已有实例运行时再启动一个 inbox --no-open,它打印出 URL 后 3 秒内以退出码 0 结束,行为是对的。所以"第二个实例会挂住"这条路径并不成立。

因此来源未定。 可能的几条(都还没验证):

  1. 启动竞态:同一时刻有多个调用,各自判断"没有实例在跑",于是都去启动,之后协调失败但没有退出。
  2. 不同的 PLANNOTATOR_PORT 或 PLANNOTATOR_DATA_DIR:那样它们会是合法的独立实例,只是 status 只显示其中一个。
  3. 启动过程中被信号打断,留下的半启动状态。

我先关掉才想到要查它们各自的端口和数据目录,所以这两项没留下证据。

影响:每份约占 120 MB,且不会自己退出,会一直累积。

建议

  1. 启动时用文件锁串行化,避免竞态。
  2. 把所有后台实例的 pid、端口、数据目录记下来,status 能一次列全,便于发现残留。
  3. 给后台实例加空闲退出:一段时间没有连接就自己结束。
Lingua principale
TypeScript
Stelle
8.7k
Fork
649
Merge medio
16h 1m
PR unite (30g)
756

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di backnotprop/plannotator

Tutte le issue di backnotprop/plannotator

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.