Replies: 6 comments 17 replies
-
|
Pinging @Ellerbach |
Beta Was this translation helpful? Give feedback.
-
|
there is no disconnect, no congestion no wifi drop. the sample code provided will run 'forever' on 1.12.4.372, but not more than a few hours any of the build in the 1.14.x or 1.15.x or 2.0.x Whether the mqtt publishes are set to 1 minute or 1 sec has no effect on how soon it crashes. I know AI can make lots of mistakes, but this is it's explanation of what's wrong: Inside MqttClient.cs, look for the event handler that processes the incoming PUBACK message. It typically looks like this: |
Beta Was this translation helpful? Give feedback.
-
|
Update — PR #3261 confirmed to fix native freeze, but exposes managed code bug The problem: Both ProcessInflightThread and KeepAliveThread have no exception handling. When the socket throws, both threads die silently. IsConnected remains true even though the connection is dead. Client code has no way to detect the failure and reconnect. Internal threads throw and die Fix needed in M2Mqtt managed code: ProcessInflightThread and KeepAliveThread need try/catch blocks that set IsConnected = false on socket exception, so client code can detect and recover. |
Beta Was this translation helpful? Give feedback.
-
|
The fix needed in M2Mqtt: but the socket shouldnt be dying to begin with, but at least we catch it. |
Beta Was this translation helpful? Give feedback.
-
|
I dont know enough of what I'm doing to do a PR; even then my suggestion is just how to handle the exception. |
Beta Was this translation helpful? Give feedback.
-
|
For reference: 4 devices on the same bench, same broker, same network, running 1.12.4 have been running uninterrupted for weeks. This is not an inherently unreliable network — it is a regression since 1.14+. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I am experiencing a silent lock-up when using nanoFramework.M2Mqtt in a long-running application. The client eventually stops processing messages, even though the connection remains active and the broker continues to function correctly.
This issue persists across recent versions, including nanoFramework 1.14, 1.15, and the 2.0.x previews.
Environment:
Hardware: ESP32-REV3, ESP32-S3 WROOM 16r8, ESP32-C3
Last Known Working Build: 1.12.4.372 (with Mqtt library 5.1.199).
Failing M2MQTT Builds: All versions after 5.1.199.
Reproduction Case:
I have isolated the issue to a simple loop. The client successfully sends messages and receives PUBACK frames, but after a few hours of operation, the internal message processing halts entirely.
Additional Notes:
I have attempted various code workarounds, but the library appears to deadlock during internal inflight queue management. The fact that this works on build 1.12.4.372 but fails on all subsequent versions suggests a regression in the library's threading or socket state management.
Beta Was this translation helpful? Give feedback.
All reactions