-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnExpireInflights method has serious performance problems #125
Comments
I will make the change for (1) and release it as 2.0.8 along with the other pending changes 👍🏻 |
cl.ops.hooks.OnQosDropped method has imposed removed messages from storage. s.hooks.OnExpireInflights method is also removed messages from storage. `func (h *Hook) OnExpireInflights(cl *mqtt.Client, expiry int64) {
}` Does this condition(if d.Created < expiry || d.Created == 0) cause all messages to be deleted? |
Hi @wind-c! I think we can use OnQosDropped in place of a new OnInflightExpired as expired inflights are dropped inflights. I will incorporate that into my fix to avoid implementing duplicate behaviour 👍
If you want to delete all inflights, see in s.inheritClientSession: existing.ClearInflights(math.MaxInt64, 0) I'll try to get the inflight expiry cleaned up later this afternoon/evening 👍🏻 |
Fixed in v2.1.0 - |
1.The OnExpireInflights method implementation of Storage hook(bolt/badger/redis) has serious performance problems. That's because loading all Inflight messages from storage into memory for processing can cause congestion and CPU and memory to balloon.
2.The Server#clearExpiredInflights calling client.ClearInflights and then executing s.hooks.OnExpireInflights is a repeat action?
The text was updated successfully, but these errors were encountered: