mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
fix(agent): start rpty lifecycle after all reads/writes (#15535)
Fixes https://github.com/coder/internal/issues/214 #15475 missed that we also write to `rpty` after starting `rpty.lifecycle()`. This PR moves the function call right at the end. Hopefully this should address the data races before we go resorting to mutexes.
This commit is contained in:
@ -78,8 +78,6 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
|
|||||||
}
|
}
|
||||||
rpty.id = hex.EncodeToString(buf)
|
rpty.id = hex.EncodeToString(buf)
|
||||||
|
|
||||||
go rpty.lifecycle(ctx, logger)
|
|
||||||
|
|
||||||
settings := []string{
|
settings := []string{
|
||||||
// Disable the startup message that appears for five seconds.
|
// Disable the startup message that appears for five seconds.
|
||||||
"startup_message off",
|
"startup_message off",
|
||||||
@ -124,6 +122,8 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
|
|||||||
return rpty
|
return rpty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go rpty.lifecycle(ctx, logger)
|
||||||
|
|
||||||
return rpty
|
return rpty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user