Log Signal K deltas at verbose level#1046
Merged
Merged
Conversation
Outbound SK deltas were logged at DEBUG and written synchronously to UART0. Under the default DEBUG runtime level they print on every delta, stalling the event loop when the TX FIFO fills on high-rate devices. Move them to VERBOSE so they are suppressed by default but available when the runtime level is raised. Refs #1045. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
Review — independent persona fan-out (4 reviewers, fresh context)Verdict: ready to merge. CI all-green. No P0/P1. Confirmed
P3 — advisory (no merge block)With Advisory
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Outbound Signal K deltas are logged at DEBUG and written synchronously to UART0. Under the default DEBUG runtime level they print on every delta, and on a high-rate device the blocking UART write stalls the event loop when the TX FIFO fills. That loop stall starves the SK WebSocket client itself, turning heavy logging into dropped deltas and disconnects.
What
Move the three delta log calls in
signalk_delta_queue.cppfromESP_LOGDtoESP_LOGV. Deltas are then suppressed at the default DEBUG level but still available when the runtime level is raised to VERBOSE for debugging — they remain the primary "is my data going out?" diagnostic, just off by default.Evidence
Validated on a live AIS device (ESP32-C3) carrying real bus traffic. Together with quieting the application's own per-message logs, the device went from loop-starved — HTTP API answering 0/8, SK WebSocket chronically "not connected", every delta dropped — to healthy: HTTP 8/8, WebSocket connected, deltas and N2K both flowing steadily, no reboot.
This is the cheap mitigation. The synchronous, blocking UART log transport is the underlying cause; anyone who raises the runtime level to DEBUG/VERBOSE re-triggers the stall. #1045 tracks the real fix (a non-blocking log transport).
Refs #1045.