Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-Parallel not correctly disposing Runspaces. Take 2 😢 #37

Closed
santisq opened this issue Jul 1, 2024 · 0 comments · Fixed by #38
Closed

Invoke-Parallel not correctly disposing Runspaces. Take 2 😢 #37

santisq opened this issue Jul 1, 2024 · 0 comments · Fixed by #38
Assignees
Labels
bug Something isn't working

Comments

@santisq
Copy link
Owner

santisq commented Jul 1, 2024

Runspace disposal issue still persists. Ref #36.

$rsBefore = Get-Runspace
do {
    $null = 0..10 | Invoke-Parallel { $_ } -ThrottleLimit 11 | Select-Object -First 1
    do {
        $rsNow = Get-Runspace
        Start-Sleep 1
    }
    while ($rsNow.RunspaceStateInfo.State -contains 'Closed')
}
until($rsNow.Count -ne $rsBefore.Count)

Compare-Object $rsNow.InstanceId $rsBefore.InstanceId
@santisq santisq added the bug Something isn't working label Jul 1, 2024
@santisq santisq self-assigned this Jul 1, 2024
@santisq santisq linked a pull request Jul 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant