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:
Jan-Otto Kröpke
2026-10-16 09:12:00 +02:00
committed by GitHub
parent 54cf194039
commit d65f37bd9c
10 changed files with 717 additions and 26 deletions
+9
View File
@@ -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