Skip to content

Commit 14ee0dc

Browse files
authored
Merge pull request #743 from jetstack/add_upload_timeout
Add upload timeout
2 parents a6b5795 + c5533e0 commit 14ee0dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/agent/run.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,14 @@ func gatherAndOutputData(ctx context.Context, eventf Eventf, config CombinedConf
331331

332332
notificationFunc := backoff.Notify(func(err error, t time.Duration) {
333333
eventf("Warning", "PushingErr", "retrying in %v after error: %s", t, err)
334-
log.Info("Warning: PushingErr: retrying", "in", t, "reason", err)
334+
log.Error(err, "Warning: PushingErr: will retry", "retry_after", t)
335335
})
336336

337337
post := func() (any, error) {
338-
return struct{}{}, postData(klog.NewContext(ctx, log), config, preflightClient, readings)
338+
postCtx, cancel := context.WithTimeout(ctx, config.BackoffMaxTime)
339+
defer cancel()
340+
341+
return struct{}{}, postData(klog.NewContext(postCtx, log), config, preflightClient, readings)
339342
}
340343

341344
group.Go(func() error {

0 commit comments

Comments
 (0)