Skip to content

Commit 24dfa16

Browse files
committed
Disable ControlPersist for sshfs connections on Windows
Lima recommended OpenSSH distribution on Windows platform has limited fucntionality over mux socket. Most notably it can't pass FDs over socket. This results in error messages and internal fallbacks, but also had higher failure rate during testing. It is reasonable to disable this for sftp-server communications on Windows to improve stability. Signed-off-by: Arthur Sengileyev <[email protected]>
1 parent 679f248 commit 24dfa16

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/hostagent/mount.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ func (a *HostAgent) setupMount(m limayaml.Mount) (*mount, error) {
6868
Readonly: !(*m.Writable),
6969
SSHFSAdditionalArgs: []string{"-o", sshfsOptions},
7070
}
71+
if runtime.GOOS == "windows" {
72+
// cygwin/msys2 doesn't support full feature set over mux socket, this has at least 2 side effects:
73+
// 1. unnecessary pollutes output with error on errors encountered (ssh will try to tolerate them with fallbacks);
74+
// 2. these errors still imply additional coms over mux socket, which resulted sftp-server to fail more often statistically during test runs.
75+
// It is reasonable to disable this on Windows if required feature is not fully operational.
76+
rsf.SSHConfig.Persist = false
77+
}
7178
if err := rsf.Prepare(); err != nil {
7279
return nil, fmt.Errorf("failed to prepare reverse sshfs for %q on %q: %w", resolvedLocation, *m.MountPoint, err)
7380
}

0 commit comments

Comments
 (0)