Give a consumer's max-deliveries key one watcher, counting what was given up (issue 440)
The dead-letter row and a max-deliveries advisory without a token both said bus.<stream>.<consumer>.max-deliveries: each look added an observation and a line of evidence through the row, and the two overwrote each other's words. The row owns the key since issue 330, so the advisory watcher leaves it, and the row now says when the newest held message was given up, so a letter held for a day no longer reads as observed every 30 seconds. Times without Happened is refused, since the raise ignored it and an update counted it.
This commit is contained in:
@@ -523,6 +523,14 @@ func watchAdvisories(f *signalFacts) []conditions.Observation {
|
||||
if a.Kind == link.AdvisoryConsumerLost && !f.lostConsumers[a.Stream+"."+a.Consumer] {
|
||||
continue // it exists again, or the mesh no longer expects it: a removal, not a loss
|
||||
}
|
||||
if a.Kind == link.AdvisoryMaxDeliveries && a.Token == "" {
|
||||
// A consumer's max-deliveries key is the dead-letter row's (novox/hq issue 330): said while
|
||||
// DEAD_LETTERS holds what it gave up on, cleared when that is delivered again or dropped. The
|
||||
// listener records no such advisory today; one read here as well added a look to the count and
|
||||
// overwrote the row's words on every look (novox/hq issue 440). Only one that could not be kept
|
||||
// (AdvisoryNotKept), which DEAD_LETTERS cannot say, is said from here.
|
||||
continue
|
||||
}
|
||||
severity := conditions.Warning
|
||||
times := ""
|
||||
if a.Count > 1 {
|
||||
@@ -568,7 +576,15 @@ func watchDeadLetters(f *signalFacts) []conditions.Observation {
|
||||
messages, them = fmt.Sprintf("%d messages", n), "them"
|
||||
}
|
||||
who := consumerWho(stream, consumer)
|
||||
// DEAD_LETTERS is a record of what was given up on: the condition counts the messages and says when
|
||||
// the newest was given up, never how often the controller looked (novox/hq issues 402 and 440).
|
||||
// Without that time it counts its looks, as a source of the present does.
|
||||
happened, times := f.deadLettersNewest[key], 0
|
||||
if !happened.IsZero() {
|
||||
times = n
|
||||
}
|
||||
out = append(out, conditions.Observation{Scope: conditions.ScopeBus, ID: key, Kind: link.AdvisoryMaxDeliveries,
|
||||
Happened: happened, Times: times,
|
||||
Machine: consumerMachine(stream, consumer), Severity: conditions.Warning,
|
||||
Summary: fmt.Sprintf("%s gave up on %s; %s kept in %s until delivered again or dropped, with why, "+
|
||||
"through the controller's dead-letters verb", link.ConsumerInWords(stream, consumer), messages,
|
||||
|
||||
Reference in New Issue
Block a user