fix(logmq): filter unsubscribed operator events before suppression - #1050
Open
samadalishah wants to merge 1 commit into
Open
Conversation
samadalishah
marked this pull request as ready for review
August 25, 2026 09:11
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
Filter unsubscribed operator events before entering their delivery suppression window.
This prevents an event that will never be emitted from:
opevent delivery failedlog;Problem
Operator-event topic filtering currently happens inside
Emitter.Emit.For events with a suppression key,
logmq.BatchProcessor.sendenters the Redis-backed suppression window before callingEmitter.Emit. This means the topic filter is applied too late.For example:
When an attempt exhausts its retries, the alert evaluator can still plan an
alert.attempt.exhausted_retriesevent. Although that topic is not subscribed, the previous delivery path was:Emitter.Emit.Emitter.Emitsees that the topic is disabled and discards it.As a result, an unsubscribed event could fail before reaching the component responsible for filtering it:
The log message was then nacked even though no exhausted-retries event was configured for delivery.
Root cause
Topic eligibility was checked after optional delivery-layer behavior:
Filtering needs to happen before any behavior specific to delivering the event:
Fix
BatchProcessor.sendnow checksEmitter.Enabledbefore entering the suppression window:Emitter.Emitretains its existing topic check as a boundary safeguard.Subscribed events continue through the same suppression and delivery path as before.
Tests
Added a regression test covering the reported configuration:
alert.destination.disabledis subscribed;context.DeadlineExceeded;alert.destination.disabledis delivered;alert.attempt.exhausted_retriesis not delivered;The existing delivery-suppression tests continue to cover subscribed exhausted-retry events, including:
Impact
Test command
go test ./internal/logmqFor maintainers
Please review if the change makes sense in a broader scope that I may be missing here as I have found this issue in my use case where I am only interested in
alert.destination.disabledevents running 3 replicas of outpost-log service specifically.