fix: reduce pressure of pilot services when errors occurs
This commit is contained in:
parent
73cea2d303
commit
ea8642e2a1
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,8 @@ const (
|
||||||
pilotInstanceInfoTimer = 5 * time.Minute
|
pilotInstanceInfoTimer = 5 * time.Minute
|
||||||
pilotDynConfTimer = 12 * time.Hour
|
pilotDynConfTimer = 12 * time.Hour
|
||||||
maxElapsedTime = 4 * time.Minute
|
maxElapsedTime = 4 * time.Minute
|
||||||
|
initialInterval = 5 * time.Second
|
||||||
|
multiplier = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
type instanceInfo struct {
|
type instanceInfo struct {
|
||||||
|
@ -219,6 +221,8 @@ func (c *client) SendInstanceInfo(ctx context.Context, pilotMetrics []metrics.Pi
|
||||||
func (c *client) sendDataRetryable(ctx context.Context, req *http.Request) error {
|
func (c *client) sendDataRetryable(ctx context.Context, req *http.Request) error {
|
||||||
exponentialBackOff := backoff.NewExponentialBackOff()
|
exponentialBackOff := backoff.NewExponentialBackOff()
|
||||||
exponentialBackOff.MaxElapsedTime = maxElapsedTime
|
exponentialBackOff.MaxElapsedTime = maxElapsedTime
|
||||||
|
exponentialBackOff.InitialInterval = initialInterval
|
||||||
|
exponentialBackOff.Multiplier = multiplier
|
||||||
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
req.Header.Set(tokenHashHeader, c.tokenHash)
|
req.Header.Set(tokenHashHeader, c.tokenHash)
|
||||||
|
|
Loading…
Reference in a new issue