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

Commit504c0cf

Browse files
committed
Better debug on reconnectingPTY
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent09dc241 commit504c0cf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎agent/agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ func (a *agent) handleReconnectingPTY(ctx context.Context, logger slog.Logger, m
967967

968968
connectionID:=uuid.NewString()
969969
logger=logger.With(slog.F("id",msg.ID),slog.F("connection_id",connectionID))
970+
logger.Debug(ctx,"handling ReconnectingPTY")
970971

971972
deferfunc() {
972973
iferr:=retErr;err!=nil {

‎coderd/workspaceapps/proxy.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
600600
if!ok {
601601
return
602602
}
603+
log:=s.Logger.With(slog.F("agent_id",appToken.AgentID))
604+
log.Debug(ctx,"resolved PTY request")
603605

604606
values:=r.URL.Query()
605607
parser:=httpapi.NewQueryParamParser()
@@ -632,19 +634,22 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
632634

633635
agentConn,release,err:=s.WorkspaceConnCache.Acquire(appToken.AgentID)
634636
iferr!=nil {
635-
s.Logger.Debug(ctx,"dial workspace agent",slog.Error(err))
637+
log.Debug(ctx,"dial workspace agent",slog.Error(err))
636638
_=conn.Close(websocket.StatusInternalError,httpapi.WebsocketCloseSprintf("dial workspace agent: %s",err))
637639
return
638640
}
639641
deferrelease()
642+
log.Debug(ctx,"dialed workspace agent")
640643
ptNetConn,err:=agentConn.ReconnectingPTY(ctx,reconnect,uint16(height),uint16(width),r.URL.Query().Get("command"))
641644
iferr!=nil {
642-
s.Logger.Debug(ctx,"dial reconnecting pty server in workspace agent",slog.Error(err))
645+
log.Debug(ctx,"dial reconnecting pty server in workspace agent",slog.Error(err))
643646
_=conn.Close(websocket.StatusInternalError,httpapi.WebsocketCloseSprintf("dial: %s",err))
644647
return
645648
}
646649
deferptNetConn.Close()
650+
log.Debug(ctx,"obtained PTY")
647651
agentssh.Bicopy(ctx,wsNetConn,ptNetConn)
652+
log.Debug(ctx,"pty Bicopy finished")
648653
}
649654

650655
// wsNetConn wraps net.Conn created by websocket.NetConn(). Cancel func

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp