@@ -121,7 +121,7 @@ func (c *haCoordinator) ServeClient(conn net.Conn, id uuid.UUID, agent uuid.UUID
121
121
for {
122
122
err := c .handleNextClientMessage (id , agent , decoder )
123
123
if err != nil {
124
- if errors .Is (err , io .EOF ) {
124
+ if errors .Is (err , io .EOF ) || errors . Is ( err , io . ErrClosedPipe ) {
125
125
return nil
126
126
}
127
127
return xerrors .Errorf ("handle next client message: %w" , err )
@@ -163,7 +163,7 @@ func (c *haCoordinator) handleNextClientMessage(id, agent uuid.UUID, decoder *js
163
163
164
164
_ , err = agentSocket .Write (data )
165
165
if err != nil {
166
- if errors .Is (err , io .EOF ) {
166
+ if errors .Is (err , io .EOF ) || errors . Is ( err , io . ErrClosedPipe ) {
167
167
return nil
168
168
}
169
169
return xerrors .Errorf ("write json: %w" , err )
@@ -215,7 +215,7 @@ func (c *haCoordinator) ServeAgent(conn net.Conn, id uuid.UUID) error {
215
215
for {
216
216
node , err := c .handleAgentUpdate (id , decoder )
217
217
if err != nil {
218
- if errors .Is (err , io .EOF ) {
218
+ if errors .Is (err , io .EOF ) || errors . Is ( err , io . ErrClosedPipe ) {
219
219
return nil
220
220
}
221
221
return xerrors .Errorf ("handle next agent message: %w" , err )
@@ -471,7 +471,7 @@ func (c *haCoordinator) handlePubsubMessage(ctx context.Context, message []byte)
471
471
// We get a single node over pubsub, so turn into an array.
472
472
_ , err = agentSocket .Write (nodeJSON )
473
473
if err != nil {
474
- if errors .Is (err , io .EOF ) {
474
+ if errors .Is (err , io .EOF ) || errors . Is ( err , io . ErrClosedPipe ) {
475
475
return
476
476
}
477
477
c .log .Error (ctx , "send callmemaybe to agent" , slog .Error (err ))
0 commit comments