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

Generalize CreateAndFetch authToken implementation #33797

Draft
wants to merge 3 commits into
base: misteriaud/ASCII-2580-fix-race-condition-in-auth-token-creation
Choose a base branch
from

Conversation

misteriaud
Copy link
Contributor

…ct) and increase the retryDelay time<!--

  • Contributors are encouraged to read our CONTRIBUTING documentation.
  • Both Contributor and Reviewer Checklists are available at https://datadoghq.dev/datadog-agent/guidelines/contributing/#pull-requests.
  • The pull request:
    • Should only fix one issue or add one feature at a time.
    • Must update the test suite for the relevant functionality.
    • Should pass all status checks before being reviewed or merged.
  • Commit titles should be prefixed with general area of pull request's change.
  • Please fill the below sections if possible with relevant information or links.
    -->

What does this PR do?

Motivation

Describe how you validated your changes

Possible Drawbacks / Trade-offs

Additional Notes

@misteriaud misteriaud changed the base branch from main to misteriaud/ASCII-2580-fix-race-condition-in-auth-token-creation February 6, 2025 18:10
@misteriaud
Copy link
Contributor Author

/trigger-ci --variable RUN_ALL_BUILDS=true --variable RUN_KITCHEN_TESTS=true --variable RUN_E2E_TESTS=on --variable RUN_UNIT_TESTS=on --variable RUN_KMT_TESTS=on

@dd-devflow
Copy link

dd-devflow bot commented Feb 6, 2025

Devflow running: /trigger-ci --variable RUN_ALL_BUILDS=true --varia...

View all feedbacks in Devflow UI.


2025-02-06 18:13:07 UTC ℹ️ Gitlab pipeline started

Started pipeline #55163060

Copy link

cit-pr-commenter bot commented Feb 6, 2025

Go Package Import Differences

Baseline: 5025a79
Comparison: b3a27bf

binaryosarchchange
agentlinuxamd64
+1, -0
+github.com/gofrs/flock
agentlinuxarm64
+1, -0
+github.com/gofrs/flock
agentwindowsamd64
+1, -0
+github.com/gofrs/flock
agentdarwinamd64
+1, -0
+github.com/gofrs/flock
agentdarwinarm64
+1, -0
+github.com/gofrs/flock
iot-agentlinuxamd64
+1, -0
+github.com/gofrs/flock
iot-agentlinuxarm64
+1, -0
+github.com/gofrs/flock
heroku-agentlinuxamd64
+1, -0
+github.com/gofrs/flock
cluster-agentlinuxamd64
+1, -0
+github.com/gofrs/flock
cluster-agentlinuxarm64
+1, -0
+github.com/gofrs/flock
cluster-agent-cloudfoundrylinuxamd64
+1, -0
+github.com/gofrs/flock
cluster-agent-cloudfoundrylinuxarm64
+1, -0
+github.com/gofrs/flock
dogstatsdlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
dogstatsdlinuxarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
process-agentlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
process-agentlinuxarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
process-agentwindowsamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
process-agentdarwinamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
process-agentdarwinarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
heroku-process-agentlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
security-agentlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
security-agentlinuxarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
security-agentwindowsamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
serverlesslinuxamd64
+1, -0
+github.com/gofrs/flock
serverlesslinuxarm64
+1, -0
+github.com/gofrs/flock
system-probelinuxamd64
+1, -0
+github.com/gofrs/flock
system-probelinuxarm64
+1, -0
+github.com/gofrs/flock
system-probewindowsamd64
+1, -0
+github.com/gofrs/flock
trace-agentlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
trace-agentlinuxarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
trace-agentwindowsamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
trace-agentdarwinamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
trace-agentdarwinarm64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock
heroku-trace-agentlinuxamd64
+2, -1
-github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
+github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl
+github.com/gofrs/flock

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 6, 2025

Static quality checks ✅

Please find below the results from static quality gates

Info

Result Quality gate On disk size On disk size limit On wire size On wire size limit
static_quality_gate_agent_deb_amd64 844.84MiB 858.45MiB 203.52MiB 214.3MiB
static_quality_gate_docker_agent_amd64 929.08MiB 942.69MiB 310.63MiB 321.56MiB

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 6, 2025

Uncompressed package size comparison

Comparison with ancestor 5025a79f8c4d17a1d33fb1758cdd2802678819c7

Diff per package
package diff status size ancestor threshold
datadog-agent-x86_64-rpm 0.12MB ⚠️ 883.15MB 883.03MB 0.50MB
datadog-agent-x86_64-suse 0.12MB ⚠️ 883.15MB 883.03MB 0.50MB
datadog-agent-amd64-deb 0.12MB ⚠️ 873.41MB 873.29MB 0.50MB
datadog-agent-aarch64-rpm 0.10MB ⚠️ 871.01MB 870.90MB 0.50MB
datadog-agent-arm64-deb 0.10MB ⚠️ 861.29MB 861.19MB 0.50MB
datadog-heroku-agent-amd64-deb 0.07MB ⚠️ 445.59MB 445.51MB 0.50MB
datadog-dogstatsd-amd64-deb 0.04MB ⚠️ 59.08MB 59.04MB 0.50MB
datadog-iot-agent-x86_64-rpm 0.04MB ⚠️ 86.22MB 86.18MB 0.50MB
datadog-iot-agent-x86_64-suse 0.04MB ⚠️ 86.22MB 86.18MB 0.50MB
datadog-dogstatsd-x86_64-rpm 0.04MB ⚠️ 59.16MB 59.12MB 0.50MB
datadog-dogstatsd-x86_64-suse 0.04MB ⚠️ 59.16MB 59.12MB 0.50MB
datadog-iot-agent-amd64-deb 0.04MB ⚠️ 86.15MB 86.11MB 0.50MB
datadog-iot-agent-arm64-deb 0.03MB ⚠️ 82.42MB 82.39MB 0.50MB
datadog-iot-agent-aarch64-rpm 0.03MB ⚠️ 82.49MB 82.46MB 0.50MB
datadog-dogstatsd-arm64-deb 0.03MB ⚠️ 56.55MB 56.52MB 0.50MB

Decision

⚠️ Warning

@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 6, 2025

Test changes on VM

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

inv aws.create-vm --pipeline-id=55283829 --os-family=ubuntu

Note: This applies to commit b3a27bf

Copy link

cit-pr-commenter bot commented Feb 6, 2025

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 0f00cfce-3b6e-4407-a297-de920939a25b

Baseline: 5025a79
Comparison: b3a27bf
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
tcp_syslog_to_blackhole ingress throughput +1.94 [+1.86, +2.02] 1 Logs
quality_gate_idle memory utilization +0.63 [+0.59, +0.67] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization +0.25 [+0.18, +0.32] 1 Logs bounds checks dashboard
file_to_blackhole_1000ms_latency_linear_load egress throughput +0.15 [-0.31, +0.61] 1 Logs
file_tree memory utilization +0.08 [+0.01, +0.14] 1 Logs
file_to_blackhole_100ms_latency egress throughput +0.06 [-0.70, +0.81] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.04 [-0.74, +0.82] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.00 [-0.27, +0.28] 1 Logs
file_to_blackhole_300ms_latency egress throughput -0.00 [-0.64, +0.63] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.01 [-0.03, +0.02] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.02 [-0.87, +0.83] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput -0.04 [-0.93, +0.85] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput -0.09 [-1.04, +0.85] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.44 [-1.22, +0.34] 1 Logs
quality_gate_logs % cpu utilization -2.38 [-5.39, +0.64] 1 Logs
uds_dogstatsd_to_api_cpu % cpu utilization -3.33 [-4.20, -2.46] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10
quality_gate_logs lost_bytes 10/10
quality_gate_logs memory_usage 10/10

Explanation

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

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

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".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.

@misteriaud misteriaud force-pushed the misteriaud/generalise_auth_creation branch from 9226d51 to b3a27bf Compare February 7, 2025 18:26
@misteriaud misteriaud changed the title implement function to safely load or generate artifacts in parallel Generalize CreateAndFetch authToken implementation Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant