Skip to content

[ACTP] add par-control process lifecycle - #54589

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
ilya/par-control-lifecycle
Aug 18, 2026
Merged

[ACTP] add par-control process lifecycle#54589
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
ilya/par-control-lifecycle

Conversation

@embeaken

@embeaken embeaken commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the initial par-control process lifecycle layer:

  • gates startup on new split mode configuration
  • starts the on-demand executor through the shared dd-procmgrd client
  • makes the executor's own idle_timeout_seconds authoritative instead of scaling it behind a control-plane stop.

Validation

  • dda env dev run -- bazel test //pkg/privateactionrunner/par-control:par-control_test //pkg/privateactionrunner/executor:executor_test //comp/privateactionrunner/impl:impl_test //pkg/procmgr/rust:dd-procmgrd_test
  • dda env dev run -- env -u PKG_CONFIG_LIBDIR cargo test -p par-control
  • dda env dev run -- env -u PKG_CONFIG_LIBDIR cargo clippy -p par-control -p dd-procmgr-client --all-targets -- -D warnings

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 66.67%
Overall Coverage: 52.48% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4fdaf12 | Docs | Datadog PR Page | Give us feedback!

@embeaken embeaken changed the title ilya/par control lifecycle [ACTP] add par-control process lifecycle Aug 7, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor 933d9f15:

Results for datadog-agent_7.84.0~devel.git.248.4fdaf12.pipeline.131425310-1_amd64.deb:

No change detected

Results for datadog-iot-agent_7.84.0~devel.git.248.4fdaf12.pipeline.131425310-1_amd64.deb:

No change detected

@dd-octo-sts

dd-octo-sts Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 933d9f1
📊 Static Quality Gates Dashboard
🔗 SQG Job

33 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
agent_deb_amd64 760.244 MiB
agent_deb_amd64_fips 713.133 MiB
agent_heroku_amd64 312.494 MiB
agent_msi 643.970 MiB
agent_rpm_amd64 760.228 MiB
agent_rpm_amd64_fips 713.117 MiB
agent_rpm_arm64 735.972 MiB
agent_rpm_arm64_fips 692.214 MiB
agent_suse_amd64 760.228 MiB
agent_suse_amd64_fips 713.117 MiB
agent_suse_arm64 735.972 MiB
agent_suse_arm64_fips 692.214 MiB
docker_agent_amd64 818.888 MiB
docker_agent_arm64 819.710 MiB
docker_agent_jmx_amd64 1009.785 MiB
docker_agent_jmx_arm64 999.260 MiB
docker_cluster_agent_amd64 210.451 MiB
docker_cluster_agent_arm64 223.456 MiB
docker_cws_instrumentation_amd64 7.439 MiB
docker_cws_instrumentation_arm64 6.877 MiB
docker_dogstatsd_amd64 39.455 MiB
docker_dogstatsd_arm64 37.560 MiB
docker_host_profiler_amd64 305.775 MiB
docker_host_profiler_arm64 317.039 MiB
dogstatsd_deb_amd64 30.200 MiB
dogstatsd_deb_arm64 28.224 MiB
dogstatsd_rpm_amd64 30.200 MiB
dogstatsd_suse_amd64 30.200 MiB
iot_agent_deb_amd64 46.448 MiB
iot_agent_deb_arm64 43.104 MiB
iot_agent_deb_armhf 43.887 MiB
iot_agent_rpm_amd64 46.448 MiB
iot_agent_suse_amd64 46.447 MiB

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 7, 2026

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Job ID: b1c56134-9f18-4dd8-ae0d-6b63d15554d1

Baseline: 6e12aad
Comparison: 143810b
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_security_idle memory utilization +0.30 [+0.19, +0.41] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization +0.26 [+0.22, +0.30] 1 Logs bounds checks dashboard
quality_gate_private_action_runner memory utilization +0.20 [+0.07, +0.33] 1 Logs bounds checks dashboard
quality_gate_security_mean_fs_load memory utilization +0.12 [+0.05, +0.19] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization -0.17 [-0.29, -0.05] 1 Logs bounds checks dashboard
quality_gate_security_no_fs_load memory utilization -0.21 [-0.35, -0.06] 1 Logs bounds checks dashboard
quality_gate_logs % cpu utilization -1.82 [-2.68, -0.95] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization -2.39 [-2.64, -2.15] 1 Logs bounds checks dashboard

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed observed_value links
quality_gate_idle intake_connections 10/10 4 = 4 bounds checks dashboard
quality_gate_idle memory_usage 10/10 172.30MiB ≤ 178MiB bounds checks dashboard
quality_gate_idle total_bytes_received 10/10 739.09KiB ≤ 819.20KiB bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 4 = 4 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 520.08MiB ≤ 538MiB bounds checks dashboard
quality_gate_idle_all_features total_bytes_received 10/10 1.14MiB ≤ 1.25MiB bounds checks dashboard
quality_gate_logs intake_connections 10/10 17 ≤ 40 bounds checks dashboard
quality_gate_logs memory_usage 10/10 203.87MiB ≤ 229MiB bounds checks dashboard
quality_gate_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_logs total_bytes_received 10/10 263.82MiB ≤ 292MiB bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 407.17 ≤ 2000 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 19 ≤ 40 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 394.75MiB ≤ 439MiB bounds checks dashboard
quality_gate_metrics_logs missed_bytes 10/10 0B = 0B bounds checks dashboard
quality_gate_metrics_logs total_bytes_received 10/10 0.94GiB ≤ 1.04GiB bounds checks dashboard
quality_gate_private_action_runner memory_usage 10/10 71.54MiB ≤ 76MiB bounds checks dashboard
quality_gate_security_idle cpu_usage 10/10 28.79 ≤ 100 bounds checks dashboard
quality_gate_security_idle memory_usage 10/10 327.18MiB ≤ 335MiB bounds checks dashboard
quality_gate_security_mean_fs_load cpu_usage 10/10 60.78 ≤ 200 bounds checks dashboard
quality_gate_security_mean_fs_load memory_usage 10/10 302.89MiB ≤ 314MiB bounds checks dashboard
quality_gate_security_no_fs_load cpu_usage 10/10 21.58 ≤ 100 bounds checks dashboard
quality_gate_security_no_fs_load memory_usage 10/10 313.43MiB ≤ 343MiB bounds checks dashboard

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_security_no_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_no_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_private_action_runner, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check total_bytes_received: 10/10 replicas passed. Gate 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 total_bytes_received: 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 total_bytes_received: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.

An error occurred while trying to automatically change base from ilya/par-control-foundation to main August 7, 2026 19:47
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 73f61a5 to 12769e4 Compare August 7, 2026 20:39
@embeaken
embeaken changed the base branch from ilya/par-control-foundation to main August 7, 2026 20:43
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 12769e4 to 9121269 Compare August 7, 2026 20:57
@github-actions github-actions Bot added the long review PR is complex, plan time to review it label Aug 7, 2026
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 9121269 to 0f54bd3 Compare August 10, 2026 15:09
@embeaken embeaken added the changelog/no-changelog No changelog entry needed label Aug 10, 2026
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 6c69553 to 94b705e Compare August 10, 2026 18:42
@embeaken
embeaken changed the base branch from main to ilya/par-control-executor-self-termination August 10, 2026 18:42
@embeaken
embeaken force-pushed the ilya/par-control-executor-self-termination branch from 50a6a7c to 5588f09 Compare August 10, 2026 18:58
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 94b705e to 2f5ff72 Compare August 10, 2026 18:58
@embeaken
embeaken force-pushed the ilya/par-control-executor-self-termination branch from 5588f09 to 2731b4e Compare August 10, 2026 19:08
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch 3 times, most recently from 2aaf840 to 441cbb0 Compare August 10, 2026 20:07
@embeaken
embeaken force-pushed the ilya/par-control-executor-self-termination branch 2 times, most recently from 067d69a to 0eb011f Compare August 10, 2026 20:39
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 441cbb0 to c8f01e1 Compare August 10, 2026 20:40
@embeaken
embeaken requested a review from sar-shah August 13, 2026 22:28
@embeaken
embeaken marked this pull request as draft August 13, 2026 22:30
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 85d1a07 to 6c22069 Compare August 13, 2026 22:31
@embeaken
embeaken marked this pull request as ready for review August 13, 2026 22:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

rust_library(
name = "par-control-lib",

P2 Badge Run buildifier on the modified BUILD file

This commit modifies BUILD.bazel, but its validation records Bazel build/test and Cargo clippy only, with no evidence that the repository-mandated bazel run //bazel/buildifier step was run. Run buildifier and commit any resulting formatting before merging.

AGENTS.md reference: AGENTS.md:L169-L169

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/privateactionrunner/par-control/src/procmgr.rs Outdated
Comment thread pkg/privateactionrunner/par-control/src/config.rs Outdated
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from 6c22069 to cd87d21 Compare August 13, 2026 23:04
@embeaken
embeaken force-pushed the ilya/par-control-executor-self-termination branch from 2d86206 to ab23c0a Compare August 13, 2026 23:10
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch from cd87d21 to 6ba350e Compare August 13, 2026 23:10
@embeaken
embeaken marked this pull request as draft August 13, 2026 23:17
@embeaken
embeaken force-pushed the ilya/par-control-executor-self-termination branch from ab23c0a to 2a98a22 Compare August 13, 2026 23:48
@embeaken
embeaken force-pushed the ilya/par-control-lifecycle branch 2 times, most recently from 481cfaf to 9960c56 Compare August 14, 2026 02:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 787ec32721

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/privateactionrunner/par-control/src/config.rs Outdated
Comment thread comp/privateactionrunner/impl/privateactionrunner.go
Comment on lines +115 to 131
fn read_fleet_policy(dir: &str) -> Result<Option<RawConfig>> {
if dir.is_empty() {
return Ok(None);
}
let path = Path::new(dir).join("datadog.yaml");
let contents = match std::fs::read_to_string(&path) {
Ok(contents) => contents,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(None),
Err(error) => {
return Err(error)
.with_context(|| format!("failed to read fleet policy: {}", path.display()));
}
};
serde_yaml::from_str(&contents)
.with_context(|| format!("failed to parse fleet policy: {}", path.display()))
.map(Some)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused as to calling it "fleet policies" ? AFAIK it as always been "agent configuration" ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into it - "fleet policies" are a subset of "agent configuration".

Specifically, "fleet policies" refer to just config overrides from the Fleet Automation system, and "agent configuration" is the full resolved config after everything including fleet policies is resolved. This PR uses "fleet policy" correctly IMO because it treats it as its own layer of config resolution.

Comment on lines +146 to +150
let value = match raw.trim() {
"1" | "t" | "T" | "TRUE" | "true" | "True" => true,
"0" | "f" | "F" | "FALSE" | "false" | "False" => false,
_ => bail!("invalid boolean value for {name}: {raw:?}"),
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems really lenient ? Is this the same in the go codebase ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the type casting uses a fork of cast library here -

return cast.ToBoolE(value)

The code for it handles a lot (GH downtime not letting me link to it...). Codex review actually complained about the behavior not matching Go when it was simpler.

Adds the initial `par-control` process lifecycle layer:

- gates startup on PAR and split mode configuration, resolved in a single pass
  over `datadog.yaml` and the fleet policy overlay;
- starts the on-demand executor through the shared `dd-procmgrd` client,
  relying on dd-procmgrd to serialize starts;
- bounds every process-manager RPC through the shared client's channel instead
  of a hand-rolled timeout wrapper;
- leaves stdout/stderr redirection to the dd-procmgrd process definition.
Treat an empty PAR boolean environment variable as unset so it falls back to
YAML or the default instead of aborting startup, matching how the fleet dir and
log level are already resolved.

Correct the idle_timeout_seconds description: the executor now self-terminates
after exactly this many seconds, not three times as many.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed internal Identify a non-fork PR long review PR is complex, plan time to review it qa/no-code-change No code change in Agent code requiring validation team/action-platform team/agent-build team/agent-devx team/agent-runtimes team/fleet-automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants