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

Commitb6e7498

Browse files
authored
fix(agent/reconnectingpty): generate rpty id before starting lifecycle (#15475)
Fixes#12687There was a race condition where we would start the rpty lifecyclebefore generating the ID, leading to a data race where we would try toconcurrently read and write the struct field.
1 parentbc9d875 commitb6e7498

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎agent/reconnectingpty/screen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
6767
timeout:options.Timeout,
6868
}
6969

70-
gorpty.lifecycle(ctx,logger)
71-
7270
// Socket paths are limited to around 100 characters on Linux and macOS which
7371
// depending on the temporary directory can be a problem. To give more leeway
7472
// use a short ID.
@@ -80,6 +78,8 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
8078
}
8179
rpty.id=hex.EncodeToString(buf)
8280

81+
gorpty.lifecycle(ctx,logger)
82+
8383
settings:= []string{
8484
// Disable the startup message that appears for five seconds.
8585
"startup_message off",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp