From c4015500fa4512e32f6b42bfb6c237856ab63914 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Thu, 13 Nov 2025 01:05:29 +0100 Subject: [PATCH 1/2] added timeout to upload task Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- pkg/agent/run.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/agent/run.go b/pkg/agent/run.go index 4da0fa13..db709e0f 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -335,7 +335,10 @@ func gatherAndOutputData(ctx context.Context, eventf Eventf, config CombinedConf }) post := func() (any, error) { - return struct{}{}, postData(klog.NewContext(ctx, log), config, preflightClient, readings) + postCtx, cancel := context.WithTimeout(ctx, config.BackoffMaxTime) + defer cancel() + + return struct{}{}, postData(klog.NewContext(postCtx, log), config, preflightClient, readings) } group.Go(func() error { From c5533e02bf70841c08a6c40d3cf04b697f5d9e57 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Thu, 13 Nov 2025 01:05:48 +0100 Subject: [PATCH 2/2] improve upload error message Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- pkg/agent/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/run.go b/pkg/agent/run.go index db709e0f..9e9831d8 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -331,7 +331,7 @@ func gatherAndOutputData(ctx context.Context, eventf Eventf, config CombinedConf notificationFunc := backoff.Notify(func(err error, t time.Duration) { eventf("Warning", "PushingErr", "retrying in %v after error: %s", t, err) - log.Info("Warning: PushingErr: retrying", "in", t, "reason", err) + log.Error(err, "Warning: PushingErr: will retry", "retry_after", t) }) post := func() (any, error) {