Repository navigation
Windows: automatic plugin update kills stale worker but fails to restart when the old port remains bound #3781
Replies: 1 comment
|
Your logs map precisely onto the restart flow in current main, and they show the gap is in the recovery path, not the kill. Walking it ( What worked. The version-mismatch kill fired correctly, and the stale PID file was removed once the process was confirmed dead. That half is fine. Where your case lands. With the port bound and health unreachable, the spawner calls To your closing question (Bun bug vs restart-flow gap): the flow gap. A dead PID still showing LISTENING plus CLOSE_WAIT/FIN_WAIT_2 entries is Windows holding the orphaned socket transiently — no user-space kill target exists, so no amount of terminate logic fixes that instant. What the restart flow is missing for exactly this state:
So: not Bun-specific, and not fixable by waiting on socket cleanup — the launcher needs the retry-then-fallback path for the |
Uh oh!
There was an error while loading. Please reload this page.
Environment
Problem
After claude-mem automatically updated from 13.16.0 to 13.16.1, the old worker was detected as a version mismatch and terminated. However, the worker port remained bound to the old PID even after the process no longer existed.
As a result, claude-mem repeatedly detected the port as occupied but could not connect to the worker health endpoint or start the new worker.
Relevant log sequence
The old worker initially started normally:
After the plugin was updated:
After that, startup repeatedly failed:
##Observed Windows state
tasklist and Get-Process confirmed that PID 10912 no longer existed, but Windows still reported:
There were also multiple CLOSE_WAIT and FIN_WAIT_2 connections associated with the same port.
The health endpoint was unreachable:
The standard worker restart command could not recover because it waited for port 37777 to become free:
Impact
Workaround
Changing CLAUDE_MEM_WORKER_PORT from 37777 to an unused port (37778) allowed the worker to start successfully.
The new worker then passed:
Expected behavior
After a plugin update:
Possible implementation direction
Could this be a known Bun/Windows socket cleanup issue, or should the worker upgrade/restart flow handle this state explicitly?
All reactions