Skip to content

Fix process spawn#5634

Draft
marcotc wants to merge 7 commits into
masterfrom
marco/issue-5621-process-spawn
Draft

Fix process spawn#5634
marcotc wants to merge 7 commits into
masterfrom
marco/issue-5621-process-spawn

Conversation

@marcotc
Copy link
Copy Markdown
Member

@marcotc marcotc commented Apr 23, 2026

Fixes #5621

What does this PR do?

Motivation:

Change log entry

Additional Notes:

How to test the change?

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 23, 2026

👋 Hey @marcotc, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-04-23 00:38:31 UTC

@dd-octo-sts dd-octo-sts Bot added the core Involves Datadog core libraries label Apr 23, 2026
@marcotc marcotc changed the title Marco/issue 5621 process spawn Fix process spawn Apr 23, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 23, 2026

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 1 untyped method and 2 partially typed methods, and clears 1 untyped method and 1 partially typed method. It decreases the percentage of typed methods from 61.33% to 61.28% (-0.05%).

Untyped methods (+1-1)Introduced:
sig/datadog/core/utils/spawn_monkey_patch.rbs:11
└── def spawn: (*untyped args) -> untyped
Cleared:
sig/datadog/core/utils/spawn_monkey_patch.rbs:11
└── def spawn: (*untyped args, **untyped opts) -> untyped
Partially typed methods (+2-1)Introduced:
sig/datadog/core/utils/spawn_monkey_patch.rbs:8
└── def self.apply!: (env_provider: ^() -> ::Hash[::String, ::String]) -> untyped
sig/datadog/core/utils/spawn_monkey_patch.rbs:14
└── def self.inject_envs: (untyped args) -> ::Array[untyped]
Cleared:
sig/datadog/core/utils/spawn_monkey_patch.rbs:14
└── def self.inject_lineage_envs: (untyped args) -> ::Array[untyped]

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

self.@env_provider: ^() -> ::Hash[::String, ::String]

def self.apply!: (lineage_envs_provider: ^() -> ::Hash[::String, ::String]) -> true
def self.apply!: (env_provider: ^() -> ::Hash[::String, ::String]) -> untyped
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
def self.apply!: (env_provider: ^() -> ::Hash[::String, ::String]) -> untyped
def self.apply!: (env_provider: ^() -> ::Hash[::String, ::String]) -> void

Copy link
Copy Markdown
Contributor

@mabdinur mabdinur left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR 😄.

Can we update the PR and add a changelog? Also we need to address some failing tests. I'd love to get this fix out as soon as possible

true
end

# Vessel for env_provider propagation.
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.

nit: We can improve clarity

Suggested change
# Vessel for env_provider propagation.
# Prepends Process.spawn to merge env_provider into the child env.

write_io.close
Process.wait(pid)

read_io.read.lines.map { |line| line.chomp.split('=', 2) }.to_h
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.

this should fix the failing tests

Suggested change
read_io.read.lines.map { |line| line.chomp.split('=', 2) }.to_h
read_io.read.lines.filter_map do |line|
parts = line.chomp.split("=", 2)
parts if parts.size == 2
end.to_h

@ivoanjo
Copy link
Copy Markdown
Member

ivoanjo commented May 6, 2026

Hey @mabdinur @marcotc since this is still an active regression, what's missing to land this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Involves Datadog core libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: datadog-2.31.0 monkey-patches Process.spawn and interferes with Ferrum

4 participants