Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not back off on timeouts when sending reports #2746

Merged
merged 1 commit into from
Jul 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 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,16 @@ func (c *appClient) doWithBackoff(msg string, f func() (bool, error)) {
backoff = initialBackoff
continue
}

if netErr, ok := err.(net.Error); ok && netErr.Timeout() {

This comment was marked as abuse.

This comment was marked as abuse.

// The timeout period itself serves as a backoff that
// prevents thrashing. Hence there is no need to introduce
// further delays. Moreover, any delays between publishing
// reports that exceed the app.window (defaults to 15s)
// cause the UI to display no data, which is debilitating.
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