Skip to content

Commit 81bafa5

Browse files
mergify[bot]efd6
andauthored
[8.19](backport #44716) x-pack/libbeat/management: make UpdateStatus a no-op when no change in state (#44743)
* x-pack/libbeat/management: make UpdateStatus a no-op when no change in state (#44716) The previous code would update and emit messages always. This would either spam logs or require that inputs handle state in addition to the work that is being done by the manager. The change here reflects the behaviour in libbeat/management which checks for change before updating. (cherry picked from commit b9ca6d5) * remove irrelevant changelog entries --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
1 parent 41f5e23 commit 81bafa5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG-developer.next.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ client will aggregate metrics by input on this registry. It'll collect
230230
`events_pipeline_published_total`.{pull}42618[42618] {issue}42761[42761]
231231
- Add new API to libbeat/monitoring/inputmon. The API allows to register and
232232
unregister input metrics without relaying on the global 'dataset' namespace.{pull}42618[42618] {issue}42761[42761]
233+
- Make `x-pack/libbeat/management.BeatV2Manager.UpdateStatus` a no-op if there is no change in state. {pull}44716[44716]
233234

234235
==== Deprecated
235236

x-pack/libbeat/management/managerV2.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ func (cm *BeatV2Manager) RegisterDiagnosticHook(name string, description string,
250250
func (cm *BeatV2Manager) UpdateStatus(status status.Status, msg string) {
251251
cm.mx.Lock()
252252
defer cm.mx.Unlock()
253-
253+
if cm.status == status && cm.message == msg {
254+
return
255+
}
254256
cm.status = status
255257
cm.message = msg
256258
cm.updateStatuses()

0 commit comments

Comments
 (0)