Fix process spawn#5634
Conversation
|
Thank you for updating Change log entry section 👏 Visited at: 2026-05-19 16:16:57 UTC |
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR introduces 1 untyped method and 1 partially typed method, and clears 1 untyped method and 1 partially typed method. Untyped methods (+1-1)❌ Introduced:Partially typed methods (+1-1)❌ Introduced:If you believe a method or an attribute is rightfully untyped or partially typed, you can add |
There was a problem hiding this comment.
The 3 fixes look good (::Hash, no kwargs splitting, not setting extra env vars if user passes unsetenv_others: true).
It's a little bit harder to review because of the rename, that's not ideal for a bug fix PR but not too bad.
From my side I think this is good to go besides adding a test for the unsetenv_others: true since that is a fix that seems not covered with tests currently.
Retain branch Process.spawn refactor (inject_envs, env_provider) and fold in master issue #5621 ::Hash clarification as documentation on inject_envs. Co-authored-by: Cursor <[email protected]>
…ers test Addresses PR review (filter_map for /usr/bin/env parsing, unsetenv_others coverage, apply! typed as void). Co-authored-by: Cursor <[email protected]>
origin/master added fork regression cases with lineage_envs_provider; align with SpawnMonkeyPatch.apply!(env_provider:) and refresh the comment. Co-authored-by: Cursor <[email protected]>
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c7adf84 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-05-19 16:40:39 Comparing candidate commit c7adf84 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 46 metrics, 0 unstable metrics.
|
…s-test Add mixed Symbol + Integer keys regression test for #5634
Fixes #5621
What does this PR do?
SpawnMonkeyPatch: one-timeprepend,super(*inject_envs(args)), mergeenv_providerwhen first arg is aHash, otherwise prepend provider env only (correct MRI inheritance andunsetenv_others).::Hash ===with a short note ([BUG]: datadog-2.31.0 monkey-patches Process.spawn and interferes with Ferrum #5621 shadowing); adds/keeps regression specs (fork shapes, env output parsing,unsetenv_others).env_provider; RBSapply!→void. Branch includes latestmasterspawn regression coverage.Motivation
2.31.0’s
Process.spawnpatch broke real callers (e.g. Ferrum) and mishandled some MRI env/option cases; we need safe forwarding and no fake full-ENV whenunsetenv_othersapplies.Change log entry
Yes. Fix Process.spawn monkey patch for MRI-correct env merging (incl. Ferrum-style calls) and
unsetenv_otherswithout injecting a synthetic full ENV.Additional Notes:
apply!(env_provider: …)to match the new API. See also Fix #5621: TypeError from constant-shadowed Hash check in Process.spawn wrapper #5773 / Drop unused **opts from Process.spawn wrapper signature #5774 onmasterfor related spawn/hash and kwargs-forwarding context.How to test the change?