DEADLINE_EXCEEDED on mqtt pkg 2.6.0
# help
r
I keep getting mqtt "DEADLINE_EXCEEDED" error on mqtt pkg 2.6.0, followed by a "out of memory" message, but I assume the OOM is caused by a new tls handshake. I checked the mqtt source, but I do not see any timeouts or deadline related to this. If someone can point me in the right direction it would be nice. 🙂 I would like to understand this exception better. https://cdn.discordapp.com/attachments/1196774072248442961/1196774072558817330/deadline_mqtt.txt?ex=65b8d9b5&is=65a664b5&hm=6846f4d9604018723c34d0c2465bf9ef04252ba0706da90b2434a83f10d72a17&
f
It's a bit weird, because the error message doesn't match up with the stack trace.
The error message is set in the
close --reason
function.
But we don't record where that happens...
The throw in line 138 just rethrows the reason it got for closing down.
r
Yes, thats why I am having problems figuring out where/why the "deadline" happens
f
If you want to know who set the reason the easiest is to add a line in the
close
function:
Copy code
close --reason=null:
  if is_closed: return
  if reason:
    catch --trace: throw "get trace"
  ...
alternatively, you can go through the places where there is a call to
close --reason=
and add a
--trace
to the
catch
that is preceding it.
Not 100% sure that would always work.
To me it looks like there are only two places where this could happen: in the
read
and in the
write
function.
r
I will add some --trace and see if i can reproduce it again
f
I wonder if it's a default timeout from the TCP socket.
Just asked Kasper and Erik if they know more.
r
Thanks!
f
Erik things there shouldn't be one.
r
It happens when we have high mqtt activity, sending around 3-5 messages per second. And if I start OTA, which starts getting the image from a http client, I start to see this error. I will keep looking 😉
k
There is a timeout on the TLS handshake.
(10s)
r
And we are getting handshakes randomly, or only when we try to (re)connect?
f
Only when connecting
r
Okay its not the tls handshake then
Cannot figure out why it happens, but it does seem related to high mqtt activity.
f
The best is probably to add more debugging information to the mqtt package.
You can just change it in the
.packages
directory. (It's read-only by default, but that's easy to change). Just remember to revert eventually (removing the directory and doing a
pkg install
).