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
Stops receiving messages #495
Comments
79b446c seems to be related. I'll try to update to 1.3.3. |
The issue reproduced on 1.3.3. |
The goroutine running under The same applies to I'm finding your log quite confusing; e.g.:
When "startIncomingComms goroutine complete" is logged the next operation is a Can you please share some more information on your code (connection options, handlers etc). Unfortunately these issues can be very difficult to diagnose and the cause is often outside of this library (e.g. a MessageHandler |
Hi I have the same problem too. In my case it usually occurs at intervals of approx 10 days working. func mqtt_connect(host string, port string) {
} func mqtt_on_msg(client MQTT.Client, msg MQTT.Message) { |
Thank you, @MattBrittan. I investigated this a bit more.
Yes, and I changed a code to log on single connection.
For non blocking case it should be less likely to happen, but I still think there is some bug somewhere and it happens in some rare conditions when lots of disconnects/reconnects happens. I will continue investigation & debug on this and will post here when will have some additional info. |
@izarraga I cant see any issues in the code you provided (but it does not include everything); unfortunately logs are really required in order to diagnose these kind of issues (there are multiple go routines running and I need to understand how they are interacting in order to trace the issue). Note that I do use the library myself (around 40 deployments with varying message volumes) and am not experiencing this issue which means it seems likely it requires a specific set of options/network conditions to manifest. If you are able to provide logs I would appreciate it; my preference would be that you provide these in a new issue (currently there is no way of knowing if the cause of your issue is the same as @dimonzozo's). @dimonzozo "Sometimes processing of incoming messages can stuck despite to be done by group of workers and sent via channels and it causes local broker to think that client is dead and disconnect it." if your message handler is blocking then this is exactly the kind of behaviour I'd expect. It is quite possible that there is a bug that occurs in rare cases but I have been unable to find one (well I've found and fixed quite a few but cannot see any in the current version); without logs from a single connection showing the failure there is little more that I can do (you are most welcome to review the code yourself and see if you can spot something I have missed). The complexity of the various go-routines is one of the reasons that we are using a much simpler approach with the v5 client. |
@dimonzozo - are you calling |
The cause of this issue may be the same as #509 which is now fixed (I believe) in |
Closing this due to lack of activity (may be fixed by either of the two most recent releases or may be due to issues in the users code - no way of knowing with the information currently available - please feel free to reopen if the issue is occurring with the latest release). |
Hi!
I was able to reproduce and capture debug log of problem with failed reconnect (version 1.3.1). When this happens client just silently stops receiving any messages.
Here how it looks like in debug log:
I spent some time to try to figure out what's going on and I think the issue is following:
use of closed network connection
errors, because disconnecting is in progresscommsStopped
channel and everything got stuck in deadlockAny fix or workaround for this will be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: