You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Track and clean up detached port-forward processes across envrc and eval workflows #330
At PR #329's base revision (257fffb9faff7e349280e8a3d960a1dc39968538), the deployer reads ROXIE_PORT_FORWARD_PID, retains the PID returned by StartDetached, exports it to the envrc file, and uses it during teardown.
However, configureCentralEndpoint starts a new detached forwarder and overwrites the previously tracked PID without stopping the previous process. This replacement-cleanup gap predates PR #329.
PR #329 adds a separate gap in roxie shell --eval: it discards the PID returned by StartDetached, and printExports does not export ROXIE_PORT_FORWARD_PID. The current shell can therefore retain a stale PID or have no PID for the new forwarder.
Required changes
Retain and export the PID of the detached forwarder created by roxie shell --eval.
Define consistent replacement handling for an existing tracked forwarder in both workflows.
After the replacement forwarder is ready, stop the previously tracked forwarder before replacing its tracked PID.
Preserve the existing forwarder and its tracking if replacement startup fails.
Ensure teardown can stop the currently tracked detached forwarder.
Handle absent, invalid, or already-exited tracked PIDs without failing the workflow. Account for stale PID safety.
Affected areas
cmd/shell.go: detached startup in eval mode.
cmd/subshell.go: environment exports.
internal/deployer/deploy_via_operator.go: detached startup and PID replacement.
internal/deployer/deployer.go: PID import, envrc export, and teardown.
internal/portforward/portforward.go: detached process lifecycle.
Activity