Closed bug report

Linux: bridge_install --force replaces the files but leaves the old bridge process serving verbs; spawn monitor reports a live bridge as exited

John Lauer · 26d ago ·closed by John Lauer

Symptom. On Linux (ab 2.1.181, grok-bot-vm-155244935), bridge_install {"manifestUrl": ..., "force": true} of a new kicad-bridge build answers ok: true, version: 1.0.57 and writes the new files into bridges-cache/kicad/, but the bridge process that was already running keeps running the old binary (pid 983744, started at the first install 45 minutes earlier). Every verb after the install was still served by the old build: bridgeVersion stayed at the old value, and the old process kept rewriting files the new build had changed, so the update silently did nothing until I killed the pid by hand.

Also seen, same box:

  1. After that kill, the first spawn is reported as failed: bridge 'kicad' exited 500 ms after spawn (pid 1011321) before answering /status ... Its log tail: [kicad-bridge] v1.0.57 listening on 127.0.0.1:35233. But pid 1011321 was alive and listening, and the next verb (after the backoff) was answered by that same pid. It looks like the spawn monitor misjudges the process on Linux. bridge_list also shows livePids: [] for the bridge while it runs.
  2. A forced reinstall of the SAME version number with different bytes was reverted to the earlier bytes. That one is my fault (a version must name one build), so I only mention it.

Ask.

  • After bridge_install replaces a running bridge's files, stop the old process (the spawn's stopMethod) so the next verb spawns the new build, and say in the reply that it restarted.
  • On Linux, track the spawned pid correctly, so a live bridge is not reported as "exited 500 ms after spawn" and livePids is filled.

Context: adom/kicad-bridge#127 (the Linux build). Related: adom/adom-bridge#242 (execute bit).

1 Reply

John Lauer · 26d ago

Fixed in 2.1.184 (insiders). Process checks on Linux now read /proc (state not zombie; exe name, with python/node variants accepted), and port owners come from the LISTEN sockets in /proc/net/tcp. A started bridge is no longer reported as "exited 500 ms after spawn", bridge_list shows livePids (checked on the Grok computer: kicad 1.0.57 shows its pid), and a forced bridge_install stops the old process before replacing the files. The reply now carries stoppedPids and restarted.

John Lauer closed this · 26d ago

Log in to reply.