Skip to content

Conversation

@bhearsum
Copy link
Contributor

While this worked very well on Linux, it causes issues anywhere we can't fork to get a new process (most notably on Windows). The problem lies in the fact that in these cases, we spawn an entire new process, which re-imports taskgraph from scratch. This is fine in some cases, but in any case where global state has been modified in an earlier part of TaskGraphGenerator._run, we lose whatever side effects happened there, and end up failing in some way.

Concretely: in gecko we add a bunch of payload_builders as part of registering the graph config. This code doesn't re-run in the spawned processes, so the payload builders don't exist there.

There are workarounds for this: for example, redoing all the earlier work of _run in each subprocess, or perhaps finding some way to ensure all the needed state is passed explicitly. There's no quick and easy way to make this work though, and some thought should be given to the tradeoffs of doing it (vs. doing nothing, or spending the effort on a different way to parallelize) before proceeding.

While this worked very well on Linux, it causes issues anywhere we can't `fork` to get a new process (most notably on Windows). The problem lies in the fact that in these cases, we spawn an entire new process, which re-imports taskgraph from scratch. This is fine in some cases, but in any case where global state has been modified in an earlier part of `TaskGraphGenerator._run`, we lose whatever side effects happened there, and end up failing in some way.

Concretely: in gecko we add a bunch of `payload_builders` as part of registering the graph config. This code doesn't re-run in the spawned processes, so the payload builders don't exist there.

There are workarounds for this: for example, redoing all the earlier work of `_run` in each subprocess, or perhaps finding some way to ensure all the needed state is passed explicitly. There's no quick and easy way to make this work though, and some thought should be given to the tradeoffs of doing it (vs. doing nothing, or spending the effort on a different way to parallelize) before proceeding.
@bhearsum bhearsum requested a review from a team as a code owner August 14, 2025 17:27
@bhearsum bhearsum requested a review from hneiva August 14, 2025 17:27
@bhearsum
Copy link
Contributor Author

This backs out #738 and #744.

Copy link
Contributor

@Eijebong Eijebong left a comment

Choose a reason for hiding this comment

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

:(

@bhearsum bhearsum merged commit 0063027 into taskcluster:main Aug 14, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants