Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit285b4e7

Browse files
committed
Avoid clobbering attach error with close errors
We want to send the error from failing to wait for the version command,not the error from closing/killing the pty or process.
1 parentaeb24d4 commit285b4e7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎agent/reconnectingpty/screen.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ func (rpty *screenReconnectingPTY) doAttach(ctx context.Context, height, width u
279279
// the same name.
280280
err=rpty.sendCommand(ctx,"version",nil)
281281
iferr!=nil {
282-
err:=ptty.Close()
283-
iferr!=nil {
284-
logger.Debug(ctx,"closed ptty with error",slog.Error(err))
282+
closeErr:=ptty.Close()
283+
ifcloseErr!=nil {
284+
logger.Debug(ctx,"closed ptty with error",slog.Error(closeErr))
285285
}
286-
err=process.Kill()
287-
iferr!=nil {
288-
logger.Debug(ctx,"killed process with error",slog.Error(err))
286+
closeErr=process.Kill()
287+
ifcloseErr!=nil {
288+
logger.Debug(ctx,"killed process with error",slog.Error(closeErr))
289289
}
290290
rpty.metrics.WithLabelValues("screen_wait").Add(1)
291291
returnnil,nil,err

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp