Skip to content

Commit

Permalink
handle connection reset by peer
Browse files Browse the repository at this point in the history
  • Loading branch information
GIC-de committed Feb 21, 2024
1 parent 057ac7d commit c2f6f76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/controller/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controller

import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down Expand Up @@ -288,10 +289,13 @@ func (r *DefaultRepository) Command(name string, command SocketCommand) ([]byte,
count, err := c.Read(buf)
received = append(received, buf[:count]...)
if err != nil {
if err != io.EOF {
return nil, err
if errors.Is(err, syscall.ECONNRESET) {
continue
}
if err == io.EOF {
break
}
break
return nil, err
}
}

Expand Down

0 comments on commit c2f6f76

Please sign in to comment.