Skip to content

Commit a7be929

Browse files
authored
cre-3245: prevent panic on empty observation while tearing down (#21878)
1 parent faea745 commit a7be929

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/services/ring/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ func (p *Plugin) getHealthyShards(shardHealth map[uint32]int) []uint32 {
172172
}
173173

174174
func (p *Plugin) Outcome(_ context.Context, outctx ocr3types.OutcomeContext, _ types.Query, aos []types.AttributedObservation) (ocr3types.Outcome, error) {
175+
if len(aos) == 0 {
176+
return nil, errors.New("RingOCR Outcome: no attributed observations")
177+
}
175178
currentShardHealth, allWorkflows, nows, wantShardVotes := p.collectShardInfo(aos)
176179
p.lggr.Infow("RingOCR Outcome collect shard info", "currentShardHealth", currentShardHealth, "wantShardVotes", wantShardVotes)
177180

0 commit comments

Comments
 (0)