Skip to content

chore: add parent PID to coder ssh log file name #16080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

aaronlehmann
Copy link
Contributor

Part of bringing coder ssh to parity with coder vscodessh is associating the log files with a particular parent process (in this case, the ssh process that spawned the coder CLI via ProxyCommand). coder vscodessh named log files using the parent PID, but coder ssh is missing this. Add the parent PID to the log file name when used in stdio mode so that the VS Code extension will be able to identify the correct log file.

See also #16078.

Part of bringing coder ssh to parity with coder vscodessh is associating
the log files with a particular parent process (in this case, the ssh
process that spawned the coder CLI via ProxyCommand). coder vscodessh
named log files using the parent PID, but coder ssh is missing this. Add
the parent PID to the log file name when used in stdio mode so that
the VS Code extension will be able to identify the correct log file.
@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Jan 9, 2025
@matifali matifali requested a review from mafredri January 9, 2025 10:12
@code-asher code-asher requested review from bcpeinhardt and Emyrk and removed request for mafredri January 9, 2025 20:29
)
if stdio {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In setStatsCallback, we use the parent pid as the filename regardless of whether or not we're in stdio mode: https://github.com/coder/coder/pull/16078/files#diff-e288cc849ca774d47294f4f6c71c4ec171f6e0b15491e7220a0144dbfc1a43bcR1213

Should we just include it in either case here as well? Trying to get a handle on how these files relate I suppose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I think this is good for compatibility though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we only want it for stdio mode because including the parent PID is only meaningful when coder ssh is invoked via ProxyCommand (which would use --stdio). Happy to change this if you prefer to be consistent, though.

There isn't a use case where we would use --network-info-dir without --stdio, but I thought I should be consistent and support it in either case. I could make it return an error when --stdio is not also specified.

@bcpeinhardt bcpeinhardt merged commit ec6645b into coder:main Jan 14, 2025
33 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants