Skip to content

Conversation

@JanProvaznik
Copy link
Member

#12863

Changes Made

spec only

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

looks pretty good.

Should we add any ETW events as part of this? What about telemetry?

## 1. Problem Statement

The MSBuild TaskHost (`OutOfProcTaskHostNode`) implements `IBuildEngine10` but lacks support for several callbacks. TaskHost is used when:
1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`** with `-mt` mode - forces non-thread-safe tasks out-of-proc
Copy link
Member

Choose a reason for hiding this comment

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

Aren't these separate cases?

Suggested change
1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`** with `-mt` mode - forces non-thread-safe tasks out-of-proc
1. **`MSBUILDFORCEALLTASKSOUTOFPROC=1`**
2. `-mt` mode - forces non-thread-safe tasks out-of-proc

- A) Forward to parent and actually yield (allows scheduler to run other work)
- B) Keep as no-op (current behavior, safest)

**Recommendation:** (B) initially - Yield/Reacquire are rarely used by tasks, and current no-op behavior has shipped. Revisit if real-world need arises.
Copy link
Member

Choose a reason for hiding this comment

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

I agree, though I think the most expensive tasks do tend to yield. Definitely something that can wait.


| Phase | Scope | Risk | Effort |
|-------|-------|------|--------|
| 1 | `IsRunningMultipleNodes` | Low | 2 days |
Copy link
Member

Choose a reason for hiding this comment

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

Still unsure if this is worth forwarding the request along vs hardcoding "yeah if you're in this mode assume parallelism".

Copy link
Member

Choose a reason for hiding this comment

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

Is -mt /m:1 (or just /mt for msbuild.exe) the only way to hit this condition? What is the practical impact on the Tasks we have that use IsRunningMultipleNodes? Do we know if any 1P Tasks care about this condition?

Copy link
Member

Choose a reason for hiding this comment

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

it's /m:1 + a taskhost for any reason (mt + unenlightened task, env var that forces everything to a task host, explicit taskhost request in usingtask).

I can't imagine that it's widely used. I see one use in our repo in the task version of the MSBuild task that changes how StopOnFirstFailure works, which is itself a silly thing to do . . .

| 1 | `IsRunningMultipleNodes` | Low | 2 days |
| 2 | `RequestCores`/`ReleaseCores` | Medium | 3 days |
| 3 | `Yield`/`Reacquire` | Medium | 3 days |
| 4 | `BuildProjectFile*` | High | 5-7 days |
Copy link
Member

Choose a reason for hiding this comment

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

BuildProjectFile is the most critical one, for XAML, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

@SimaTian is that the one you hit in roslyn?

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.

3 participants