8000 add EverypipeTimeoutSecond to ForEach-Object-Parallel · Issue #18027 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
add EverypipeTimeoutSecond to ForEach-Object-Parallel #18027
@kasini3000

Description

@kasini3000

Summary of the new feature / enhancement

Context:

Q:how to limit time for everypipe on ForEach-Object-Parallel?
Apparently, -timeoutsecond can't do that.

It can be understood like this:
If there is no "-ThrottleLimit" parameter, -TimeoutSeconds is basically as expected.
But now there is the "-ThrottleLimit" parameter, which makes -TimeoutSeconds unable to limit the runtime of each parallel.
**“-ThrottleLimit” and “-timeoutsecond” cause subsequent pipes to time out without starting execution **

So,we need -EverypipeTimeoutSecond.
time begin: from every parallel start

@PaulHigin


-timeoutsecond can't do that.

-timeoutsecond can limit total time for all pipes.
If there are many pipes and the execution time of each pipe is inconsistent, then limit total time does not look so good.
Both in the manual and in actual tests it is demonstrated that:

1..10 | ForEach-Object -ThrottleLimit 1 -TimeoutSeconds 2 -Parallel {
	Start-Sleep -Seconds 1
	$_
}

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Cmdletsgeneral cmdlet issuesWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0