[serial_proxy] Split refused-write logging by cause

Writes are the only high-rate, unacknowledged operation, so a legacy
client streaming without a subscription would flood WARN one line per
request. Contention (another client holds the port) stays WARN; the
never-subscribed case logs at VERBOSE. One-shot operations keep WARN
in both cases since their request/ack pattern bounds the rate.
This commit is contained in:
kbx81
2026-09-03 00:35:44 -05:00
parent 0224929624
commit 29b5935a22
@@ -278,7 +278,14 @@ void SerialProxy::write_from_client(api::APIConnection *api_connection, const ui
// Bytes from anyone but the live subscriber would interleave with the subscriber's
// traffic -- or with an active tap's -- on the wire
if (!this->is_subscriber_(api_connection)) {
ESP_LOGW(TAG, "Ignoring write from client without port subscription [%" PRIu32 "]", this->instance_index_);
if (this->api_connection_ != nullptr) {
ESP_LOGW(TAG, "Ignoring write from client that does not hold serial proxy [%" PRIu32 "]", this->instance_index_);
} else {
// A legacy client streaming writes without subscribing would flood WARN, one per
// request; writes are the only high-rate, unacknowledged operation, so keep this
// visible without drowning the log
ESP_LOGV(TAG, "Ignoring write from client without port subscription [%" PRIu32 "]", this->instance_index_);
}
return;
}
#endif