fix: recover reconnect after incomplete output capture
This commit is contained in:
1 parent
b52ca5a7c2
commit
6906ed52f2
9 files changed
+692
-3
No files matched your search
@@ -232,7 +232,12 @@ func (server *AgentServer) serveConnection(parent context.Context, connection *w
|
||||
server.writeLoop(sessionContext, connection, queue, heartbeat, started)
|
||||
cancel()
|
||||
}()
|
||||
defer func() { <-writerDone }()
|
||||
defer func() {
|
||||
// A reader can end before the writer observes the closed transport.
|
||||
// Cancel first so cleanup does not wait for the next heartbeat write.
|
||||
cancel()
|
||||
<-writerDone
|
||||
}()
|
||||
|
||||
for {
|
||||
messageType, payload, err = connection.Read(sessionContext)
|
||||
|
||||
Reference in new issue
Block a user