From 88d0f9c40112b723d14e0ff687559260afba4f0d Mon Sep 17 00:00:00 2001 From: andig Date: Sat, 23 May 2026 10:01:37 +0200 Subject: [PATCH] MQTT: cleanup deletes at QoS 0, synchronously (#30139) --- plugin/mqtt/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/mqtt/client.go b/plugin/mqtt/client.go index 4afc5adba..73da06bae 100644 --- a/plugin/mqtt/client.go +++ b/plugin/mqtt/client.go @@ -154,7 +154,11 @@ func (m *Client) Cleanup(topic string, retained bool) error { } m.log.TRACE.Printf("delete: %s", msg.Topic()) - m.Publish(msg.Topic(), true, "") + // Delete synchronously at QoS 0 so the cleanup burst self-throttles + // to one in-flight message at a time and avoids overwhelming the + // broker (see #30086). + token := m.client.Publish(msg.Topic(), 0, true, "") + token.WaitTimeout(request.Timeout) // reset timeout timer.Reset(time.Second)