fix(rules): propagate initiate() errors through Manager.Start and ruler provider - #12567
Open
rossigee wants to merge 1 commit into
Open
fix(rules): propagate initiate() errors through Manager.Start and ruler provider#12567rossigee wants to merge 1 commit into
rossigee wants to merge 1 commit into
Conversation
Manager.Start() previously logged initiate() failures and continued to run() anyway, leaving the ruler in a broken state. Ruler provider.Start also ignored any returned error. - Manager.Start now returns the initiate() error instead of swallowing it - Ruler provider propagates the error through Start() so the registry can mark the service as failed and exit cleanly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/query-service/rules/manager.goManager.Startswallowedinitiate()errors and proceeded torun()anyway, leaving the ruler in a broken state with no signal in the registry logs.pkg/ruler/signozruler/provider.gocompounded the problem by callingprovider.manager.Start(ctx)without inspecting the return value.Manager.Startnow returnserrorand surfaces theinitiatefailure instead of logging-and-continuingsignozruler.provider.Startpropagates that error so the factory registry marks the ruler service asStateFailedand exits, consistent with every other Start error pathCloses #12565
Changes
pkg/query-service/rules/manager.go—Start(ctx)now returnserror;initiatefailure short-circuits beforerunpkg/ruler/signozruler/provider.go— capture and returnmanager.Starterror fromprovider.StartVerification
go build ./...— cleangolangci-lint run ./pkg/query-service/rules/... ./pkg/ruler/... ./pkg/factory/... ./pkg/alertmanager/...— 0 issuesgo test -race ./pkg/query-service/rules/... ./pkg/ruler/... ./pkg/factory/...— passingRisk
The
Manager.Startreturn signature changes fromvoidtoerror. Tree-wide audit (grep -rnE "\\.Manager\\.Start\\b|manager\\.Start\\b" pkg/ ee/ cmd/) confirmspkg/ruler/signozruler/provider.go:81is the only caller — already updated in this commit. No external consumers of*rules.Managerexist outsidepkg/ruler/.Follow-up (out of scope)
pkg/query-service/rules/manager_test.goexercisesNewManagerand rule evaluation but does not exerciseStartfailure. A regression test that stubs dependencies to failinitiateand assertsStart(ctx) != nilwould lock in this behaviour.