mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-20 19:49:03 +02:00
scheduled_task: run COM work on long-lived workers (#2741)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -159,6 +159,15 @@ exercised a live Windows role.
|
||||
patterns, and MI NULL values from populated unions. Respect borrowed/owned
|
||||
pointers, allocator-specific cleanup and COM thread initialization; use the
|
||||
native COM helpers rather than restoring the removed `go-ole` dependency.
|
||||
Run COM calls on an `ole.Worker` or another long-lived COM thread that
|
||||
`Build` starts and `Close` stops; initializing and uninitializing COM per
|
||||
scrape unloads in-process COM servers each time. A COM call cannot be
|
||||
interrupted: if `Collect` waits for one, wait without a deadline of its own
|
||||
(`ole.Do` with `context.Background()`), so that the collection's busy-skip
|
||||
handles a hung call instead of every later scrape queueing behind it.
|
||||
- A collector's `Close` waits at most 3 seconds (`closeTimeout`) for its own
|
||||
workers, below the 5 seconds the collection gives all collectors to close.
|
||||
Document what a worker still running after that does with its resources.
|
||||
- Keep CLI and YAML validation consistent. Reject unknown fields, unsupported
|
||||
sub-collector names and invalid values; preserve CLI precedence and repeated
|
||||
flag/list behavior. Changes to config shapes also need schema, flag parsing
|
||||
|
||||
Reference in New Issue
Block a user