cubemaster: log score-plugin failures instead of silently skipping them - #1457
cubemaster: log score-plugin failures instead of silently skipping them#1457dwin-gharibi wants to merge 1 commit into
Conversation
…rors swallowed Signed-off-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
| continue | ||
| } | ||
| if tmpResult, err := f.Select(selCtx); err != nil { | ||
| log.G(selCtx.Ctx).Warnf("runScoreFilter_skipped, selector: %s, err: %v", f.ID(), err) |
There was a problem hiding this comment.
Non-blocking observations on this log line:
- It only covers the
err != nilpath, but several built-in scorers return empty-success rather than an error on their silent paths — e.g.realTimeWeightedAverageScore.Selectreturns(nil, nil)atrealtimescore.go:62-65and:74-76, andaffinityScore.Selectreturns an empty list ataffinityscore.go:54-56. Those still look identical to a disabled plugin, which is the exact gap the PR motivation describes. Empty-success staying silent is probably intentional (no result isn't a failure), but it may be worth a brief comment or doc note so future readers don't greprunScoreFilter_skippedexpecting to see them. - Since
Disable()skips at line 187 without logging,_skippedcould be misread as covering disabled plugins.runScoreFilter_failedwould match the existingrunFilter_failedshape more literally — though_skippedis arguably more accurate for a per-plugin skip. Just a naming nit, no change required.
The change itself is correct and the message shape/level are consistent with the codebase.
Review: cubemaster: log score-plugin failures instead of silently skipping them (#1457)Overall: Approve — correct, minimal, well-scoped observability change. No correctness issues found. The PR adds a single
Scoring behaviour is genuinely unchanged — this is observability only, as stated. Non-blocking observations
On the test decisionNo new test for a logging-only change is reasonable; existing scoring-path coverage is unaffected. AI-generated review — not a human approval. |
Closes #1456.
Motivation
runScoreFilterswallowed score-plugin errors with a barecontinue. A plugin failing on every calllooked exactly like a disabled one, and because
totalPluginWeightonly accumulates for plugins thatreturned results, a persistently failing plugin silently drops out of the weighted average and skews
placement — with nothing in the log to explain it.
The filter stage already reports its failures (
schedule.go:127), so this was an inconsistencybetween the two stages.
What this changes
CubeMaster/pkg/scheduler/schedule.go— one line added to the existing error branch:f.ID()is part of thescore.Selectorinterface (pkg/selector/score/init.go:21), so the plugin isnamed in the log. The message shape follows the existing
runFilter_failedconvention. Warn levelmatches
runFilter.Scoring behaviour is unchanged — this is observability only.
No comment changes.
Testing
No new test: the change adds a log line inside an existing branch and alters no logic, so there is no
new behaviour to pin. Existing coverage for the scoring path continues to pass.
CI gates checked locally:
gofmt -l ./pkg/scheduler— clean (fmt-check).GOOS=linux go build ./pkg/scheduler/— clean.Related, not fixed here
parallelRunFiltersdiscards the context returned byerrgroup.WithContext(
schedule.go:139), so filter goroutines never observe cancellation when a sibling fails. Left out tokeep this PR to one concern; tracked with the scheduler filter-intersection issue.