libwebsockets icon indicating copy to clipboard operation
libwebsockets copied to clipboard

ESP-IDF: Removed explicit `esp_task_wdt_reset` call

Open vikramdattu opened this issue 11 months ago • 3 comments

Why is esp_task_wdt_reset needed?:

  • If the task is running for longer without yielding, this leads to the task watchdog to trigger, then one should reset the task watchdog with the mentioned API.

Points under consideration while removing the call:

  • lws_service() function call is not unyielding, meaning, it does wait on socket select. Even if this function is called in a loop, it should be the caller's responsibility to yield or call esp_task_wdt_reset.
  • Rightly so, the examples here do yield calling taskYIELD
  • Calling esp_task_wdt_reset without calling esp_task_wdt_add has no real use and only leads benign errors.

vikramdattu avatar Feb 05 '25 10:02 vikramdattu

cc @Harshal5

vikramdattu avatar Feb 05 '25 10:02 vikramdattu

@lws-team the libwebsockets library has been added as a managed component of esp-protocols, and merging this PR is crucial for us to move forward with adding other example codes, such as a server instance.

glmfe avatar Mar 24 '25 23:03 glmfe

Can I suggest you take a more sensitive approach to what is already there than randomly ripping it out?

It's not like what is there is so golden it must last a thousand years, but, there are users of the existing code such as Amazon. since it is enabled on AMAZON_FREERTOS currently, I think that should remain so for them.

If you want to avoid what it is doing, then use a cmake define to override, defeating it or somesuch, rather than act like esp is the only user of it.

lws-team avatar Mar 25 '25 08:03 lws-team