J. Nick Koston c694e96f24 [logger] Hold recursion guard while draining the task log buffer
The synchronous logging path holds the main-task recursion guard around
notify_listeners_, but the buffered drain in Logger::process_messages_ did not.
When a message logged from a non-main thread was drained on the main loop and a
listener (the API log forwarder, or a logger.on_message automation) logged again
on the main task, that re-entrant log reused the shared tx_buffer_ and the API
shared_write_buffer_ while they were still in use, corrupting the in-flight
message; on ESP32 this surfaced as a StoreProhibited panic in the API send path.

Hold a RecursionGuard on main_task_recursion_guard_ across the drain so re-entrant
main-task logs are dropped there too, mirroring the synchronous path.

Adds an integration test that drives the buffered drain with a re-entrant
on_message log and verifies the buffered messages are delivered uncorrupted.
2026-06-18 14:07:03 -05:00
2023-06-12 17:00:34 +12:00
2022-09-06 15:48:01 +12:00
2024-03-28 10:20:51 +13:00
2025-12-08 14:37:45 -05:00
2026-06-11 12:41:19 +12:00
S
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme Multiple Licenses
584 MiB
Languages
C++ 56.1%
Python 43.3%
C 0.3%
JavaScript 0.2%