Skip to content

Conversation

@JanProvaznik
Copy link
Member

Summary

Decouples the Sidecar TaskHost from the regular TaskHost to separate concerns:

  • Regular TaskHost (nodemode:2): Short-lived, no callback support
  • Sidecar TaskHost (nodemode:4): Long-lived, designed for callback forwarding

Changes

  • OutOfProcTaskHostNodeBase.cs: New abstract base class with ~900 lines of shared functionality
  • OutOfProcTaskHostNode.cs: Refactored to inherit from base, callbacks log MSB5022 or throw NotImplementedException
  • SidecarTaskHostNode.cs: New class for sidecar taskhost with callback support infrastructure
  • XMake.cs: Factory pattern routing nodemode:2 → OutOfProcTaskHostNode, nodemode:4 → SidecarTaskHostNode
  • NodeProviderOutOfProcTaskHost.cs: Dynamically chooses nodemode based on nodeReuse setting
  • DebugUtils.cs: Recognizes nodemode:4 as SidecarTaskHostNode

Node Modes

  • /nodemode:1\ - Worker node (OutOfProcNode)
  • /nodemode:2\ - Regular TaskHost (short-lived, no callbacks)
  • /nodemode:4\ - Sidecar TaskHost (long-lived, callback support)
  • /nodemode:8\ - Server node

Related

Prepares infrastructure for #12991 (IBuildEngine callback forwarding in taskhosts)

Testing

  • 90 TaskHost tests pass
  • 9 TaskHostFactory tests pass

- Created OutOfProcTaskHostNodeBase as abstract base class with shared functionality
- OutOfProcTaskHostNode: Regular taskhost with stub IBuildEngine callbacks (unchanged behavior)
- SidecarTaskHostNode: Sidecar taskhost that will support callback forwarding to parent
- XMake.cs: Factory pattern to instantiate correct node type based on nodeReuse flag

This separates the concerns so that callback infrastructure is only in SidecarTaskHostNode,
keeping the regular taskhost simple and avoiding the back-and-forth IPC overhead when not needed.
- Regular TaskHost uses /nodemode:2 (OutOfProcTaskHostNode)
- Sidecar TaskHost uses /nodemode:4 (SidecarTaskHostNode) when nodeReuse is enabled
- Update NodeProviderOutOfProcTaskHost to select nodemode based on nodeReuse
- Update DebugUtils to recognize nodemode:4 as SidecarTaskHostNode
- Update IsInTaskHostNode() to include both node types
@JanProvaznik
Copy link
Member Author

meeting outcome: this is not needed

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.

1 participant