Skip to content

Commit 12a9d63

Browse files
authored
fix(agent): start rpty lifecycle after all reads/writes (#15535)
Fixes coder/internal#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.
1 parent aca5be5 commit 12a9d63

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
@@ -78,8 +78,6 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
7878
}
7979
rpty.id = hex.EncodeToString(buf)
8080

81-
go rpty.lifecycle(ctx, logger)
82-
8381
settings := []string{
8482
// Disable the startup message that appears for five seconds.
8583
"startup_message off",
@@ -124,6 +122,8 @@ func newScreen(ctx context.Context, cmd *pty.Cmd, options *Options, logger slog.
124122
return rpty
125123
}
126124

125+
go rpty.lifecycle(ctx, logger)
126+
127127
return rpty
128128
}
129129

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy