espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
591 stars 254 forks source link

Configurable task watch dog for the MQTT task code (IDFGH-8588) #234

Closed jrepp closed 1 year ago

jrepp commented 1 year ago

When the ESP MQTT client calls into user code it's possible to encounter deadlocks related to user locking or scheduling problems. The task watchdog timer is a failsafe that helps detect and restart the device in the presence of these types of problems.

david-cermak commented 1 year ago

Thanks for this PR and sorry for such a late response. We somehow missed this and in the meantime a support for custom event id was implemented. It seems to me that these events could be used to both init the WDT (as it's executed from the mqtt task context), as well as to update it.


Please check if https://github.com/espressif/esp-mqtt/commit/97503cceb3eac8bb341e55e4a876cd7c1f3ae29b could be used

jrepp commented 1 year ago

That looks workable and happy to close this PR. It turns out to be pretty useful in a production setting, but I'm sure other people can figure out how to implement it themselves.