fix(Telemetry,HealthMonitor): bump task stacks to fix reboot-every-10min crash
TelemetryTask (4096B) overflowed its stack canary because flushRuntimeToSD() nests ArduinoJson serialization + SD write + a LOG_DEBUG call that fans out to Logging::log()'s 512B format buffer and publishToMqtt()'s String + AsyncMqttClient::publish() — all on the same small stack. Bumped to 8192B. HealthMonitor's monitoring task shares the same nested-logging pattern (11 LOG_* calls per health check pass) and was judged next most likely to trip, so bumped 4096B -> 6144B pre-emptively. RAM headroom confirmed fine post-bump (19.2%, 63KB/320KB used). Root cause, other at-risk tasks, and the planned logging-queue redesign are documented in feature-catalog.md F-051. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,10 @@ void Telemetry::begin() {
|
||||
loadStrikeCounters();
|
||||
loadMetrics();
|
||||
|
||||
xTaskCreatePinnedToCore(telemetryTask, "TelemetryTask", 4096, this, 2, &telemetryTaskHandle, 1);
|
||||
// 8192: flushRuntimeToSD() nests ArduinoJson serialization + SD write + LOG_DEBUG
|
||||
// (512B format buffer + MQTT publish String + AsyncMqttClient::publish()) on this
|
||||
// task's own stack. 4096 overflowed the canary in production — see stack-audit notes.
|
||||
xTaskCreatePinnedToCore(telemetryTask, "TelemetryTask", 8192, this, 2, &telemetryTaskHandle, 1);
|
||||
LOG_INFO(TAG, "Telemetry initialized");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user