Commit Graph
6 Commits
Author SHA1 Message Date
Nick Babcock 993dadd4dd Impose WMI timeouts (#444)
WMI queries do not have a timeout by default and can subsequently hang.
This commit adds timeouts to avoid these hangs.

On timeout, `Get` will throw a `ManagementException` that has an error
code of `ManagementStatus.Timedout`. In the case of abstract storage,
this exception will be silently swallowed and the statistics from WMI
not updated until the next update interval, which seems appropriate.

The storage group, on the other hand, a timeout there would cause an
initialization exception which would be propagated up to the caller
(which seems ok as something must be terribly wrong for that WMI query
to fail).

The code was also updated to call dispose for all the WMI objects. I
don't see this causing a behavior difference, but I found it better to
be safe than sorry.

The timeouts were chosen to be a compromise between returning in a
reasonable timeframe and allowing WMI, which can be terribly slow, to
return the query.
2021-05-14 09:24:50 +02:00
Phyxion 5d7f476711 Fixes #266
Groups must be locked during reset, otherwise the collection can be modified while enumerating.
2020-07-17 09:48:35 +02:00
Phyxion 3cc3d9139c Add support for multiple processor groups.
Merge from upstream.
2020-05-11 13:29:52 +02:00
Phyxion 5bd108167d Restore OHM in copyright statement 2020-02-28 11:39:25 +01:00
Phyxion 6309cbe5a5 Apply code style 2020-02-17 13:12:24 +01:00
Phyxion 73378f7c7b Code style #130 (#132)
This closes #99.
2019-09-23 19:29:10 +02:00