chef / wmi-lite

Lightweight, low-dependency wrapper for basic WMI functionality on Windows.
Apache License 2.0
13 stars 8 forks source link

Timeoutadding timeout to wmi connection initialization and query #3

Open mwrock opened 9 years ago

mwrock commented 9 years ago

I made the default behavior the same as it is today and now you have to pass a timeout to the initializer. So once this releases, I'll update the calls from ohai. I'm hoping customers suffering from hung wmi calls can just update their ohai gem without updating the chef client.

adamedx commented 9 years ago

It's starting to look like maybe ExecQueryAsync https://msdn.microsoft.com/en-us/library/aa392108(v=vs.85).aspx is the way to go. Or perhaps something in the application itself that doesn't kill any threads but simply exits the process.

@chefsalim, in this case, I think using timeout is ok IF you exit the process when it times out. That's a problem with putting the timeout in this gem, so maybe the right thing is to document the behavior that if you specify a timeout, you must exit the process.