← Back to Pull requests

[procmgr] pass the supervisor environment to same-user children #59122

Closed
unknown closed this pull request without merging on Oct 29, 2026 11:12 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 15:26 UTC
Author

What does this PR do?

This restores #59008 after the revert in #59109. A child that runs as the same user as dd-procmgrd receives the supervisor environment. DD_PM_SOCKET_PATH is included. Other DD_PM_ names stay with the process manager.

On Linux and macOS that is every child. On Windows it is a privileged spawn and an agent spawn that reuses the supervisor token. A logon as another account still receives only the names in DD_PM_INHERIT_ENV_PREFIXES and DD_PM_INHERIT_ENV_NAMES. environment_file and env: still override, except on a privileged Windows process, which still refuses them.

Motivation

Variables set on the host or injected into the container stayed on dd-procmgrd. The child only saw names from its YAML or the allowlist, so AWS Secrets Manager resolution failed in Private Action Runner split mode unless each name was added by hand (cloud-inventory#74153). An allowlist cannot cover every variable a customer sets.

#59008 dropped every DD_PM_ name. The container entrypoint used to pass DD_PM_SOCKET_PATH through the DD_ allowlist, and Docker and Kubernetes listen on /opt/datadog-agent/run/dd-procmgrd.sock rather than the default. par-control then dialed the default socket, never started the executor, and timed out. That is #incident-62746. Those split suites did not run on the original PR: --impacted only sees Go coverage, and the test process does not import pkg/procmgr.

Describe how you validated your changes

The same-user env unit test keeps dd_pm_socket_path and still drops DD_PM_CONFIG_DIR. The procmgr end-to-end test starts a daemon on a non-default socket and checks that the child receives that path and still does not receive DD_PM_CONFIG_DIR. DD_PM_TEST_SECRET stays hidden. cargo fmt and cargo clippy -D warnings are clean.

Additional Notes

The two commits have to land together. Restoring #59008 without the socket exception brings the incident back.

Diff: 252 lines (+189 / -63) across 3 files Reviewer: dd-gplassard Review duration: 1185m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 252 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.331
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #59122"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39% (MEDIUM) · Higher = larger blast radius
39%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%