MQTT: cleanup deletes at QoS 0, synchronously (#30139)

This commit is contained in:
andig 2026-05-23 10:01:37 +02:00 • committed by GitHub
parent 04b7e076a7
commit 88d0f9c401
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)