From d8fa5ace1b68ac0f312cfc6929fa703da5392f12 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 1 Mar 2026 15:37:02 -1000 Subject: [PATCH] document stale read tolerance in hint read comment --- esphome/core/lwip_fast_select.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/core/lwip_fast_select.h b/esphome/core/lwip_fast_select.h index 9e35a95dd6..46c6b711cd 100644 --- a/esphome/core/lwip_fast_select.h +++ b/esphome/core/lwip_fast_select.h @@ -31,9 +31,10 @@ struct lwip_sock *esphome_lwip_get_sock(int fd); /// Check if a cached LwIP socket has data ready via unlocked hint read of rcvevent. /// This avoids lwIP core lock contention between the main loop (CPU0) and -/// streaming/networking work (CPU1). Correctness is preserved because sockets are -/// nonblocking and EWOULDBLOCK is handled as normal — a stale hint simply means -/// we retry on the next loop iteration. +/// streaming/networking work (CPU1). Correctness is preserved because callers +/// already handle EWOULDBLOCK on nonblocking sockets — a stale hint simply causes +/// a harmless retry on the next loop iteration. In practice, stale reads have not +/// been observed across multi-day testing, but the design does not depend on that. /// /// The sock pointer must have been obtained from esphome_lwip_get_sock() and must /// remain valid (caller owns socket lifetime — no concurrent close).