Skip to content

Commit 9b0b80a

Browse files
committed
Revert SSH conn handling
1 parent 9936923 commit 9b0b80a

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

agent/agent.go

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -645,24 +645,15 @@ func (a *agent) init(ctx context.Context) {
645645
sshLogger.Info(ctx, "ssh connection ended", slog.Error(err))
646646
},
647647
Handler: func(session ssh.Session) {
648-
err := a.trackConnGoroutine(func() {
649-
err := a.handleSSHSession(session)
650-
var exitError *exec.ExitError
651-
if xerrors.As(err, &exitError) {
652-
a.logger.Debug(ctx, "ssh session returned", slog.Error(exitError))
653-
_ = session.Exit(exitError.ExitCode())
654-
return
655-
}
656-
if err != nil {
657-
a.logger.Warn(ctx, "ssh session failed", slog.Error(err))
658-
// This exit code is designed to be unlikely to be confused for a legit exit code
659-
// from the process.
660-
_ = session.Exit(MagicSessionErrorCode)
661-
return
662-
}
663-
})
648+
err := a.handleSSHSession(session)
649+
var exitError *exec.ExitError
650+
if xerrors.As(err, &exitError) {
651+
a.logger.Debug(ctx, "ssh session returned", slog.Error(exitError))
652+
_ = session.Exit(exitError.ExitCode())
653+
return
654+
}
664655
if err != nil {
665-
a.logger.Warn(ctx, "track ssh session failed", slog.Error(err))
656+
a.logger.Warn(ctx, "ssh session failed", slog.Error(err))
666657
// This exit code is designed to be unlikely to be confused for a legit exit code
667658
// from the process.
668659
_ = session.Exit(MagicSessionErrorCode)

cli/root_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ ExtractCommandPathsLoop:
121121

122122
got := buf.Bytes()
123123
// Remove CRLF newlines (Windows).
124-
// got = bytes.ReplaceAll(got, []byte{'\r', '\n'}, []byte{'\n'})
124+
got = bytes.ReplaceAll(got, []byte{'\r', '\n'}, []byte{'\n'})
125125

126126
// The `coder templates create --help` command prints the path
127127
// to the working directory (--directory flag default value).

0 commit comments

Comments
 (0)