-
Notifications
You must be signed in to change notification settings - Fork 87
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
Make -Force parameter in Stop-RSJob permanent so it "just works" #43
Comments
Was this ever implemented or was it subsequently removed? I'm trying to use Stop-RSJob to stop hung WMI calls in my scriptblock, and the call to Stop-RSJob is just hanging as well. This is on 1.7.3.9, and I'm also not seeing a -Force parameter in the function. |
please show output of Stop-RSJob with -Verbose -Debug switches |
That produced the following, which doesn't appear to be much help. It doesn't do anything beyond that, it's hung up at this point. DEBUG: Begin |
Do you tried to use the latest from GitHub ? Maybe the fix already here or maybe the hang occurs inside the powershell itself (or WMI) and we can't help you a lot |
I'm using 1.7.3.9 which I believe is the latest version. I looked at the code for stop-rsjob and those are the only messages I see, it appears that it's hanging on [void] $_.InnerJob.Stop(). I know it's a WMI call that's causing it to hang, but I should still be able to kill that thread similar to other scripts where we're using the native Stop-Job commands. There's a lot of overhead using Powershell jobs, so I've been working on converting to using PoshRSJob instead. |
The latest here is 1.7.3.11, it not marked as release but have important fix which can be decisive in your case. Similar deadlocks was eliminated in some other places inside module. |
I downloaded and tested 1.7.3.11 and it hangs up on the same statement. I don't know what it is about WMI that causes this, I've tried various techniques to prevent this and still run into server that cause the WMI call to just hang indefinitely. Killing the thread seems to be the only option left. |
what so special about these WMI calls ? |
Nothing special about the WMI call, just gathering drive space information using Win32_Volume. It's not clear exactly what's wrong with WMI that's causing this, as most of the time if WMI needs to be fixed the call fails. We've also tried multiple ways to get the WMI call to timeout as well, but still occasionally run into servers where the WMI call will hang indefinitely and cause Powershell to hang. As I mentioned we have a workaround using Powershell jobs to run against servers in parallel, since we can successfully kill the job for an individual server. I thought that Stop-RSJob would work the same way and kill that runspace, but it just hangs. |
Stop-RSJob should "just work" without the need of the -Force parameter so it doesn't hang on waiting for a job to finish. Fix already completed and just needs uploaded tonight.
The text was updated successfully, but these errors were encountered: