Skip to content

Commit

Permalink
do not back off on timeouts when sending reports
Browse files Browse the repository at this point in the history
...since doing so unnecessarily throttles report sending, to the point
where the app is receiving reports so infrequently that often it has
no data to show.

The timeout period itself is sufficient to prevent thrashing.

Fixes #2745.
  • Loading branch information
rade committed Jul 25, 2017
1 parent 518a0e2 commit c4e991a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion probe/appclient/app_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/rpc"
"net/url"
Expand Down Expand Up @@ -215,7 +216,11 @@ func (c *appClient) doWithBackoff(msg string, f func() (bool, error)) {
backoff = initialBackoff
continue
}

if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
log.Errorf("Error doing %s for %s: %v", msg, c.hostname, err)
backoff = initialBackoff
continue
}
log.Errorf("Error doing %s for %s, backing off %s: %v", msg, c.hostname, backoff, err)
select {
case <-time.After(backoff):
Expand Down

0 comments on commit c4e991a

Please sign in to comment.