fix(canary): Reconnect immediately upon tail max duration (#14287)

pull/14299/head
Emad Mohamadi 2 years ago committed by GitHub
parent 59ff1ece1d
commit 9267ee3561
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      pkg/canary/reader/reader.go

@ -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())

Loading…
Cancel
Save