Repository navigation
fix(orcad): an SSH host launch no longer deletes its own PID file - #52191
Conversation
The nohup launch backgrounds its whole && chain, so the PID removal added in #51342 ran in the background and could delete the PID file the foreground had just written. The host's server then read as unverifiable and connect failed. Remove the old PID before the chain instead.
[Medium impact] The PR appears safe to merge. SummaryMoves PID-file removal before the background launch chain so an SSH launch cannot delete its newly written PID.
No new actionable issues were found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "test(orcad): a failed PID write leaves n..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…tom; prove every desktop and orcad path - Known C5 failures no longer mark whole tests. Only one assertion is forgiven, on the new path, and only when the page shows the row's symptom (C5-L312: the typed line never reached the shell, which ends at an empty prompt; C5-L310: the editor shows the disk file). Any other error still fails. L312 loses a race, so a pass is fine; L310 fails when it passes, so a fix drops the mark. - The job logs each desktop and host orcad's layout path and checks them, as the servers job does; browser-routing proves its orcad too. - The server setting is validated before it reaches the host's shell, and every Docker host and volume is removed in its own finally. - orcad-remote-empty-markers test synced to main's #52191.
…ane (#52103) * test(layout-owner): run the SSH Docker orcad specs in the switch-on lane Restores the ssh-orcad journeys (cut 11-21) into the layout-owner suite, passes the server setting to the Docker host's orcad through sshd, and checks the orcad took it. * ci(layout-owner): give the SSH lane's orcad template a placeholder phone page * test(layout-owner): forward app logs from restart launches * ci(layout-owner): start the SSH lane as soon as the window build is uploaded * ci(layout-owner): build the orcad template while the window build runs * test(layout-owner): print the host server's files when an SSH spec fails * test(layout-owner): list the host slot and processes on SSH spec failure * ci: retrigger the layout-owner lane * fix(orcad): an SSH host launch no longer deletes its own PID file The nohup launch backgrounds its whole && chain, so the PID removal added in #51342 ran in the background and could delete the PID file the foreground had just written. The host's server then read as unverifiable and connect failed. Remove the old PID before the chain instead. * test(layout-owner): mark the SSH lane's known switch-on failures (C5) and both-mode drift * test(layout-owner): fit two SSH specs to today's close dialog copy and setup-script prompt * ci: rerun the layout-owner lane * test(layout-owner): scope the SSH lane's known failures to their symptom; prove every desktop and orcad path - Known C5 failures no longer mark whole tests. Only one assertion is forgiven, on the new path, and only when the page shows the row's symptom (C5-L312: the typed line never reached the shell, which ends at an empty prompt; C5-L310: the editor shows the disk file). Any other error still fails. L312 loses a race, so a pass is fine; L310 fails when it passes, so a fix drops the mark. - The job logs each desktop and host orcad's layout path and checks them, as the servers job does; browser-routing proves its orcad too. - The server setting is validated before it reaches the host's shell, and every Docker host and volume is removed in its own finally. - orcad-remote-empty-markers test synced to main's #52191. * test(layout-owner): forgive C5-L312 only on a new terminal's first command, and C5-L310 only on the exact disk text - Lost-keys forgiveness is opt-in at each first-command site, and only counts when the tab was just opened by openTerminalTab and nothing else has been typed into it; any expectPaneText consumes it. After a reconnect, relaunch, update or sleep, failures stay red. - The symptom is now a pane holding only its single initial prompt: no echoed input and no output, so a command that ran and failed (even a wrapped one) never matches. - hostCliUntilOk forgives only when no attempt ever got an answer. - The draft check forgives only when the editor shows exactly the host file's text. - root-owner's second, managed Open-in-Terminal pane gets the same first-command check. * test(layout-owner): fix SSH lane CI: no casts, current browser-drop behavior, first-command opt-in for the fault journey
ELI5
When the desktop starts Orca's server on an SSH host, it writes down the server's process number in a file so it can check on it later. Since #51342, a cleanup step that was meant to run before that write could run after it, deleting the file. The server was running fine, but the desktop could no longer prove it, so connecting failed with "Orca couldn't start its server on this host. Try connecting again."
Before / after
.orcad-pid.Mechanism
In shell,
a && b && { ... } &backgrounds the wholea && b && ...list, not just the last group. #51342 putrm -f "$orcad_pid"inside that list, so it ran in the background, racing the foregroundecho $! > pid.tmp && mv pid.tmp pid. The background side has several commands to run first, so it usually lost the race the wrong way and deleted the new file. The removal now runs as its own foreground statement before the chain, which keeps #51342's intent (no stale PID survives a failed write) without the race. The WSLsetsidpath also gets the earlier removal; it was not affected because it does not background the chain.Not in any release yet (v1.4.280 predates #51342).
How it was tested
ps), readiness written,.orcad-pidmissing.orcad-remote-empty-markers.integration.test.ts: runs the generated nohup launch in/bin/shwith a stub slot, waits for its readiness line (written only after exec, so every launch step has run), then checks the PID file names the process and the liveness probe says LIVE. It fails on main and passes with this change. It replaces a test that only checked the command text and asserted the buggyrm -f "$orcad_pid" &&form.pnpm tc:node, oxlint, and the file's tests pass locally.Visible changes
Connecting to an SSH host works again where it showed "Orca couldn't start its server on this host" (unreleased regression).
Performance
None, because the launch runs the same commands; one
rmmoves out of the chain.