Skip to content

Commit

Permalink
fix(canary): Reconnect immediately upon tail max duration (#14287)
Browse files Browse the repository at this point in the history
  • Loading branch information
emadolsky authored Sep 27, 2024
1 parent 59ff1ec commit 9267ee3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/canary/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ func (r *Reader) run() {
// or times out based on the above SetReadDeadline call.
err := unmarshal.ReadTailResponseJSON(tailResponse, r.conn)
if err != nil {
var e *websocket.CloseError
if errors.As(err, &e) && e.Text == "reached tail max duration limit" {
fmt.Fprintf(r.w, "tail max duration limit exceeded, will retry immediately: %s\n", err)

r.closeAndReconnect()
continue
}

reason := "error reading websocket"
if e, ok := err.(net.Error); ok && e.Timeout() {
reason = fmt.Sprintf("timeout tailing new logs (timeout period: %.2fs)", timeoutInterval.Seconds())
Expand Down

0 comments on commit 9267ee3

Please sign in to comment.