[procmgr] pass the supervisor environment to same-user children #59122
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
dd-gplassard
What does this PR do?
This restores #59008 after the revert in #59109. A child that runs as the same user as
dd-procmgrdreceives the supervisor environment.DD_PM_SOCKET_PATHis included. OtherDD_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_PREFIXESandDD_PM_INHERIT_ENV_NAMES.environment_fileandenv: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 passDD_PM_SOCKET_PATHthrough theDD_allowlist, and Docker and Kubernetes listen on/opt/datadog-agent/run/dd-procmgrd.sockrather than the default.par-controlthen 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:--impactedonly sees Go coverage, and the test process does not importpkg/procmgr.Describe how you validated your changes
The same-user env unit test keeps
dd_pm_socket_pathand still dropsDD_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 receiveDD_PM_CONFIG_DIR.DD_PM_TEST_SECRETstays hidden.cargo fmtandcargo clippy -D warningsare clean.Additional Notes
The two commits have to land together. Restoring #59008 without the socket exception brings the incident back.