-
Notifications
You must be signed in to change notification settings - Fork 521
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
Publishing freeze on connection lost #325
Comments
eclipse#325 Signed-off-by: Konstantin Konnov <konstantin.konnov@litmusautomation.com>
I believe that the fix introduces a new issue; if WriteTimeout is set to 0 (the default) then the "case <-time.After(c.options.WriteTimeout):" triggers immediately. This sometimes (approx 10% in my test code) ends up getting selected before the write to c.obound meaning that the publish message token is flagged as being in error state incorrectly (and the published message is lost despite AutoReconenct and persistence being active). While setting WriteTimeout to a non-zero value would fix this the default value is currently is 0 (supposed to mean no timeout) and when used with AutoReconenct and Persistence these values make sense as the data will be written at some point. The simplest solution might be:
|
eclipse#325 Signed-off-by: Konstantin Konnov <konstantin.konnov@litmusautomation.com>
@ChIoT-Tech sorry, I didn't notice this. Fixed. Better would be to using contexts but this will change API. |
eclipse/paho.mqtt.golang#325 Signed-off-by: Konstantin Konnov <konstantin.konnov@litmusautomation.com>
eclipse/paho.mqtt.golang#325 Signed-off-by: Konstantin Konnov <konstantin.konnov@litmusautomation.com>
Closing this because the change has been merged. |
Version: master
If the option
options.AutoReconnect
is false thenoptions.MessageChannelDepth
is set to 0 here. So, we have a channel with zero length. When we get into the linepaho.mqtt.golang/client.go
Line 602 in 0d81c29
Publish
function.The text was updated successfully, but these errors were encountered: