datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

Add `Scheduled` as retry status

Open keisku opened this issue 1 year ago • 2 comments

What does this PR do?

Add new Scheduled status in pkg/util/retry.

Motivation

After adding this status, I will use it as below to suppress same debug logs.

git diff | cat
diff --git a/pkg/util/containers/cri/util.go b/pkg/util/containers/cri/util.go
index 5c4fb37697..ab49b6f1e0 100644
--- a/pkg/util/containers/cri/util.go
+++ b/pkg/util/containers/cri/util.go
@@ -126,7 +126,11 @@ func GetUtil() (*CRIUtil, error) {
 	})

 	if err := globalCRIUtil.initRetry.TriggerRetry(); err != nil {
-		log.Debugf("CRI init error: %s", err)
+		if retry.IsScheduled(err) {
+			log.Trace("CLI init scheduled")
+		} else {
+			log.Debugf("CRI init error: %s", err)
+		}
 		return nil, err
 	}
 	return globalCRIUtil, nil

In my environment, there are more than 400 debug logs like below in last 15 minutes.

CRI init error: temporary failure in criutil, will retry later: try delay not elapsed yet

2024-07-02_22-14-48

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

The status and functions added in this PR are intended to be used in subsequent PRs, so there will be no change in the Agent’s behavior.

keisku avatar Jul 02 '24 13:07 keisku

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=38127974 --os-family=ubuntu

Note: This applies to commit 364a8341

pr-commenter[bot] avatar Jul 02 '24 13:07 pr-commenter[bot]

Regression Detector

Regression Detector Results

Run ID: e56d611a-5052-4474-94f4-ce1e1faef67a Metrics dashboard Target profiles

Baseline: 87f361073054a1a912c42f5ad16152c05b536f50 Comparison: 364a8341d5c0c376187de30c8ec29444e8b444f0

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00% Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
tcp_syslog_to_blackhole ingress throughput +3.02 [-10.05, +16.09] Logs
pycheck_1000_100byte_tags % cpu utilization +1.55 [-3.25, +6.35] Logs
otel_to_otel_logs ingress throughput +0.18 [-0.64, +0.99] Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.00, +0.00] Logs
idle memory utilization -0.36 [-0.41, -0.32] Logs
file_tree memory utilization -0.39 [-0.44, -0.34] Logs
basic_py_check % cpu utilization -0.87 [-3.49, +1.76] Logs
uds_dogstatsd_to_api_cpu % cpu utilization -1.20 [-2.09, -0.32] Logs

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

pr-commenter[bot] avatar Jul 02 '24 14:07 pr-commenter[bot]