-
Notifications
You must be signed in to change notification settings - Fork 51
Client Hangs during subscribe or unsubscribe #110
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
Comments
Running it a few more times, I've seen it take 195s to hang. And it also got to 411s once then has an OS error. time = 411.3s |
can you wrap in try/except? wifi is just not a reliable transport |
I could try something like that, although most of the time it does not produce an exception. So I think I'd still be relying on some kind of watchdog timer. I've actually tried switching to http rather than mqtt, (which is much slower due to overheads) but hasn't produced any errors like this so far. |
it should definitely not 'hang' - can you determine where the hang occurs? |
Just ran my example again, it hung after 8.7s. i.e stopped printing anything.
|
This is with that latest adafruit_minimqt release 5.3.2 |
kk what if the delay is shorter or longer between sub & unsub? just trying to get as much reproducability deets |
Tried no delay and 2s delays. Same behaviour. Further digging with print statements... When it 'hangs', I can see It is stuck in the |
Maybe getting into the boundary between python and C now...
gives me output like this, where I don't understand why rc= would only be printed some of the time.
|
I am having the same problem on
connect() that is hanging, however the underlying issue is the same I believe.
For details see https://forums.adafruit.com/viewtopic.php?p=937190#p937190 |
I believe this issue has been resolved. My minimal example doesn't "hang" with the new version of this library. Although I did get a timeout exception, which I think is desirable behaviour.
|
I've been seeing intermittent failures with MQTT, where function calls can hang and never return.
I've been working around it with a watchdog timer to detect the condition and hard reset the device, which is pretty ugly.
I think various things can cause it, but seems to be reproducable with subscribe or unsubscribe
If I run the code below, it typically loops for 10-30s before getting stuck. Sometimes longer.
Potentially another symptom of an underlying problem, see other issues e.g.
#107
#101
I have also tried this with a completely different MQTT broker / service, and had similar results. Quicker to fail if anything.
So I don't think this is down to the Adafruit IO server.
I wondered about throttling, but the time to failure seems too inconsistent
Adafruit CircuitPython 7.3.0 on 2022-05-23; Adafruit Feather ESP32S2 with ESP32S2
Minimal example
The text was updated successfully, but these errors were encountered: