Skip to content

Disable ControlPersist for sshfs connections on Windows #3376

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
Apr 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/hostagent/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func (a *HostAgent) setupMount(m limayaml.Mount) (*mount, error) {
Readonly: !(*m.Writable),
SSHFSAdditionalArgs: []string{"-o", sshfsOptions},
}
if runtime.GOOS == "windows" {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a code comment to the explain the reason

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Description added in code and in the commit message.

// cygwin/msys2 doesn't support full feature set over mux socket, this has at least 2 side effects:
// 1. unnecessary pollutes output with error on errors encountered (ssh will try to tolerate them with fallbacks);
// 2. these errors still imply additional coms over mux socket, which resulted sftp-server to fail more often statistically during test runs.
// It is reasonable to disable this on Windows if required feature is not fully operational.
rsf.SSHConfig.Persist = false
}
if err := rsf.Prepare(); err != nil {
return nil, fmt.Errorf("failed to prepare reverse sshfs for %q on %q: %w", resolvedLocation, *m.MountPoint, err)
}
Expand Down
Loading