Skip to content

Commit cebf100

Browse files
committed
Refactor pusher engine: add metrics for dropped messages
Instead of logging an error, add to the metrics when the queue is full and a message needs to be dropped instead of sent. https://github.com/onflow/flow-go/blob/85913ad09e605fb5234155301bb0d517946a75a5/engine/collection/compliance/engine.go#L139-L146
1 parent 88a7d45 commit cebf100

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

engine/collection/pusher/engine.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,11 @@ func (e *Engine) Process(channel channels.Channel, originID flow.Identifier, mes
182182
// SubmitCollectionGuarantee adds a collection guarantee to the engine's queue
183183
// to later be published to consensus nodes.
184184
func (e *Engine) SubmitCollectionGuarantee(msg *messages.SubmitCollectionGuarantee) {
185-
ok := e.queue.Push(msg)
186-
if !ok {
187-
engine.LogError(e.log, fmt.Errorf("failed to store collection guarantee in queue"))
188-
return
185+
if e.queue.Push(msg) {
186+
e.notifier.Notify()
187+
} else {
188+
e.engMetrics.OutboundMessageDropped(metrics.EngineCollectionProvider, metrics.MessageCollectionGuarantee)
189189
}
190-
e.notifier.Notify()
191190
}
192191

193192
// publishCollectionGuarantee publishes the collection guarantee to all consensus nodes.

0 commit comments

Comments
 (0)