collector: bound MI probe queries in Build with a timeout (#2657)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-10 18:05:15 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 1302cf6899
commit 465fccbe69
9 changed files with 45 additions and 5 deletions
+2
View File
@@ -95,6 +95,8 @@ exercised a live Windows role.
the original `Collection` owns collectors and MI resources. A timed-out call
may still be running: prevent overlap, drain late metrics and do not free its
resources while it runs. Honor the supplied scrape budget in blocking APIs.
`Build` has no budget: bound its MI probe queries with `mi.BuildQueryTimeout`,
never `0` (no MI timeout), so one stalled provider cannot block startup.
- Release resources after partial initialization and on error paths. A non-nil
PDH collector returned with an error still belongs to the caller and must be
closed. Sub-collector cleanup closures must read the initialized field when