Skip to content

Include Receive Job Error Stream Redirect#2511

Open
dpaulson45 wants to merge 1 commit intomainfrom
dpaul-HcNetAdapter
Open

Include Receive Job Error Stream Redirect#2511
dpaulson45 wants to merge 1 commit intomainfrom
dpaul-HcNetAdapter

Conversation

@dpaulson45
Copy link
Member

Issue:
When there is an Error that doesn't stop the job, but it does when we attempt to receive it. This then causes the job to fail because of Receive-Job -ErrorAction Stop

Reason:
The original reason why the -ErrorAction Stop was included was to prevent the message being displayed. However, this then causes the job to fail, that would have then succeeded.

Fix:
Add Error Stream redirect to all the job to still be received but not display the error message either.
Resolved #2504

Validation:
Lab/pester tested. Customer tested

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Health Checker job-queue receive logic to avoid terminating the overall run when a job emits non-terminating errors that become terminating during Receive-Job -ErrorAction Stop, while still suppressing on-screen error output.

Changes:

  • Adds a RedirectReceiveJobErrorStream parameter to Wait-JobQueue (defaulting to enabled).
  • When enabled, changes Receive-Job to redirect the error stream (2>$null) instead of using -ErrorAction Stop.
Comments suppressed due to low confidence (1)

Shared/JobManagementFunctions/Wait-JobQueue.ps1:26

  • Adding the new parameter in the middle of the param() list changes positional binding: callers that previously invoked Wait-JobQueue positionally (e.g., passing scriptblocks as the 2nd/3rd arguments) will now bind those values to RedirectReceiveJobErrorStream instead of ProcessReceiveJobAction/CatchActionFunction. To avoid a breaking change, move RedirectReceiveJobErrorStream to the end of the parameter list or explicitly set [Parameter(Position=...)] for the existing parameters to preserve the previous positions.
    param(
        [int]$MaxJobsPerServer = 5,

        [bool]$RedirectReceiveJobErrorStream = $true,

        [ScriptBlock]$ProcessReceiveJobAction,

        [ScriptBlock]$CatchActionFunction
    )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dpaulson45 dpaulson45 requested a review from Copilot February 25, 2026 16:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dpaulson45
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dpaulson45
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Add Error Stream redirect to all the job to still be received, but not display the error message either.
@dpaulson45
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] - Health Checker - Get-NetAdapter throws hidden errors causing the script to fail

2 participants