Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/infra/Services/Spoolman/FilamentCoverageSpoolResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,20 @@ private SpoolReadBudget ReadBudget()
}
catch (Exception ex)
{
// Deliberately broad (CodeQL "generic catch clause"): this helper's contract is to
// never fail. Failing to READ a timeout must not become the very outage that
// timeout exists to prevent, so every failure degrades to defaults. The concrete
// SettingsService throws InvalidOperationException for an unregistered type, but
// _settingsService is an interface and another implementation may surface its own
// storage or binding failures; enumerating them would be fragile in exactly the
// direction that stalls the fleet. Nothing is hidden - the exception is logged -
// and no cancellation can be swallowed here, because this path is synchronous and
// takes no CancellationToken.
// Deliberately broad (CodeQL cs/catch-of-all-exceptions; to be dismissed as won't-fix
// on alert #6069 - see PR for #2315): this helper's contract is to never fail. Failing
// to READ a timeout must not become the very outage that timeout exists to prevent,
// so every failure degrades to defaults. Narrowing to InvalidOperationException was
// evaluated and rejected: that's the only exception the current, sole production
// ISettingsService.Get<T>() implementation throws deliberately, but _settingsService
// is an interface, not that concrete type - a narrower catch would silently couple
// this "never fail" contract to today's single implementation and start failing this
// read the moment any other implementation (or a future change to this one) surfaces
// its own storage or binding failure through Get<T>(). Enumerating every exception
// type a conforming implementation might throw would be fragile in exactly the
// direction that stalls the fleet, so the catch stays broad. Nothing is hidden - the
// exception is logged - and no cancellation can be swallowed here, because this path
// is synchronous and takes no CancellationToken.
_logger.LogDebug(ex, "[FilamentCoverage] Falling back to default spool read budget");
}

Expand Down
Loading