Repository navigation
Conversation
|
Thanks for your first pull request to Reticle! A maintainer aims to review within two days. Before then, |
|
| if (null !== statusPid) { | ||
| return { | ||
| action: KillAction.KILL, | ||
| pid: statusPid, | ||
| forced: false, | ||
| identifiedListener: false, | ||
| }; |
There was a problem hiding this comment.
On Windows or another system without lsof, a process that binds the configured port can serve a fake /status response containing an unrelated process’s PID. If there is no live recorded PID, this branch selects that value and runKill signals the unrelated process, even without --force. Checking that the value is a positive integer does not show that it belongs to the port holder.
How this was verified: The status probe accepts parsed HTTP JSON without authenticating its PID, and the no-listener path passes that PID to process signaling.
| ): Promise<boolean> { | ||
| const presence = await probePresence(port, { tcpOpen: probeDaemon, status: fetchStatus }); | ||
| const recorded = readPid(port); | ||
| const status = presence === PortPresence.DAEMON ? await fetchStatus(port) : undefined; |
There was a problem hiding this comment.
Second status request can fail
The initial presence check already receives a /status response, but this fallback discards it and makes another request. If the second request times out or fails when neither lsof nor a live PID file is available, planKill refuses to stop the daemon despite the successful first response. Reusing that response would avoid the extra failure window and request.
| reason: | ||
| 'The port answers /status as a Reticle daemon, but Reticle could not determine its pid. ' + | ||
| 'Refusing to report success because the daemon is still running.', |
There was a problem hiding this comment.
This new user-facing refusal message is inline rather than a named constant. The new survived-kill notes follow the same pattern. The repository requires every domain, wire, and UI string to be a named constant, so these messages need to satisfy that requirement before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
This cannot enter the merge queue yet. CI shows a syntax error in |
b39267c to
93910c4
Compare
divshekhar
left a comment
There was a problem hiding this comment.
The approach is sound: the netstat -ano fallback accepts LISTENING sockets only, refuses when no pid is known, and re-checks the port afterwards. The tests go red without the fix. Some cleanup is needed before merge:
- Dead code. The new
pidon/statusis never read, thestatusreturned byprobePresenceWithStatusis unused, and the newkillparameter onterminatehas no caller. Either use the status pid or remove all three. - Garbled comment around
cli-kill.ts:230. - Restored test. Bring back the safety test that loops over both
forcevalues ("never plans to kill without a pid"). - PR body. It mentions a "/status pid fallback" test that doesn't exist.
Note that CI's windows job is skipped on PRs, so netstat will first run in the merge queue.
divshekhar
left a comment
There was a problem hiding this comment.
Thanks for sticking with this. The netstat fallback is the right idea. The last review's items are still open on this head: the unused /status pid, probePresenceWithStatus's status and terminate's kill parameter (use them or remove all three), the comment near cli-kill.ts:230, the restored safety test that loops over both force values, and the PR description. One more thing: main already parses netstat -ano in server/src/command/setup/terminal/listeners.ts (parseNetstatListeners, with tests). Please reuse that rather than adding a second parser. If the directory-reach guard refuses cli -> setup, move the parser to a place both can import. Please rebase without the merge commit (the merge queue can't replay merges), then run pnpm verify.
|
Hi, thanks for the detailed feedback, and apologies for the delayed response. I’ve been working through the issues and cleaning up the implementation. I’ve addressed the initial syntax, formatting, and DCO blockers, but I’m also going back through the remaining review comments, including reusing the existing I’m checking the changes carefully and will rerun |
93910c4 to
87e1da8
Compare
divshekhar
left a comment
There was a problem hiding this comment.
Thank you for the work. The dead code is gone, and the safety test that loops over both force values is back. These items remain.
- Do not add a second netstat parser.
parseNetstatPortHolder(server/src/command/cli/ports/port-holder.ts:133) copiesparseNetstatListenersinserver/src/command/setup/terminal/listeners.ts. MoveparseNetstatListenersto a module that bothcli/portsandsetup/terminalcan import. Then filter its rows by port. - Remove
-p tcpatport-holder.ts:166. On Windows,netstat -p tcpshows only IPv4 sockets, so a daemon on[::1]is never found. Your IPv6 test passes only because it gives the parser the row directly. Main callsnetstat -anowithout-p. - Fix the broken comment at
server/src/command/cli/cli-kill.ts:223-224. - Commits
48643cd58and850c399d0mergemain. The merge queue cannot replay them. Rebase onto main withgit rebase origin/mainand force-push. - Add a
.changes/entry.reticle killon Windows is a user-facing change.
Then run pnpm verify.
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
850c399 to
fde1971
Compare
divshekhar
left a comment
There was a problem hiding this comment.
Thank you. The shared netstat parser, the removed -p tcp and the .changes entry are good. Two items remain.
- Item 3 of the last review: the broken comment is still at
cli-kill.ts:221-223. Please fix it. - The branch has a copy of main's release commit
07a656a6(the same patch). Rungit fetch origin && git rebase origin/mainto drop it, then force-push.
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
5752cef to
b2402b4
Compare
Signed-off-by: SmashRex <afolabitemiloluwa4@gmail.com>
What & why
Fixes Windows daemon shutdown when
lsofis unavailable.Closes #1243
How it was verified
/statuswhen no listener or PID file is available./statusidentifies a daemon but no PID can be determined.runKilldoes not report success when the killed process exits but the port remains occupied./statuspayload.cli-kill.test.ts: 9 tests passedstatus-why.test.ts: 13 tests passedpnpm --filter @reticlehq/server lint: passedpnpm typecheck: passedgit diff --check: passedpnpm test:unit: 75/76 tests passed; the remaining failure is the existing Windows symlink test in@reticlehq/cli-realm, which fails withEPERMwhen creating a symlink.Gates run
pnpm lint && pnpm typecheck && pnpm test:unit(~2 min — always) —test:unitis currently blocked by the Windows symlinkEPERMfailure described above.pnpm test:e2e(~8 min) — touched the tool surface,core, an observer, or telemetrypnpm gate:install(~15 min) — touchedreticle init,vite-plugin,next, orbabel-pluginpnpm test:e2e:desktop(~3 min) — touchedadapters/realm/electron,adapters/realm/tauri, or desktop captureChecklist
git commit -s) — CI's DCO check fails the PR without it.any, no free strings (wire strings live in@reticlehq/core), no non-null!console.logor internal tracking codes left in the diff.changes/(never editCHANGELOG.md— that file is assembled at release time, and editing it is what makes PRs conflict; format in.changes/README.md)docs/telemetry.md) and are covered by a test