fix(wg_mgr): yield 1 tick per peer in disco_periodic_probes - #49
Merged
Conversation
On a large tailnet the full DISCO probe loop can run 50-170ms back-to-back with no yield point, starving other same-core tasks (wg_mgr shares core 1 with coord) long enough to trip watchdogs on real hardware. A 1-tick vTaskDelay between peers gives them scheduler time without measurably affecting DISCO cadence. Adapted from cplewes/microlink@9f6af750. Closes #24 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fudio101
force-pushed
the
fix/disco-probe-yield
branch
from
August 18, 2026 16:49
489b6bc to
75a47d3
Compare
1 task
fudio101
added a commit
that referenced
this pull request
Aug 18, 2026
…R_SUPPORTED (#50) * fix(config_httpd): gate temp-sensor code behind CONFIG_SOC_TEMP_SENSOR_SUPPORTED esp_driver_tsens was an unconditional REQUIRES and the temp-sensor init/ read/deinit calls were unconditional too, breaking the build on SoC variants without a temperature sensor. Gate both behind CONFIG_SOC_TEMP_SENSOR_SUPPORTED; handler_monitor still always returns a temp_c JSON field (null when unsupported) so the REST API shape is unchanged. Cherry-picked from liestrela/microlink@1649d987. Closes #29 Co-authored-by: Adrian.Nguyen-Qualgo <nguyen.ndt@qualgo.net> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * docs: mark FORK_PRS.md rows for issues #24 and #29 done Row 5 (#24, PR #49) was missed when marking rows done in the prior batch. Row 10 (#29) is this PR. Co-authored-by: Adrian.Nguyen-Qualgo <nguyen.ndt@qualgo.net> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> * fix(build): keep esp_driver_tsens REQUIRES unconditional Kconfig-gating a REQUIRES entry silently no-ops in this build (documented a few lines above for esp_driver_uart/esp_driver_gpio, same root cause): REQUIRES is resolved before Kconfig is available, so CONFIG_SOC_TEMP_SENSOR_SUPPORTED evaluates false regardless of target and esp_driver_tsens never gets linked in -- while ml_config_httpd.c's post-Kconfig #if CONFIG_SOC_TEMP_SENSOR_SUPPORTED is true on esp32s3, so it tries to include a header from a component that was never required. CI caught this: "driver/temperature_sensor.h: No such file or directory" on every v6.0.1 build. The CONFIG_SOC_TEMP_SENSOR_SUPPORTED check in ml_config_httpd.c already correctly gates the feature at compile time; only the REQUIRES gating attempt was wrong. Co-authored-by: Adrian.Nguyen-Qualgo <nguyen.ndt@qualgo.net> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: liestrela <estrela@riseup.net> Co-authored-by: Adrian.Nguyen-Qualgo <nguyen.ndt@qualgo.net> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
What
disco_periodic_probes()iterates every active peer with no yield point inbetween. On a large tailnet the full loop can run 50-170ms back-to-back;
since
wg_mgrshares core 1 withcoord(seeCLAUDE.md's task table),this starves
coord(and anything else pinned to core 1) long enough totrip watchdogs on real hardware. Adds
vTaskDelay(1)at the top of eachper-peer iteration — gives other same-core tasks scheduler time without
measurably affecting DISCO cadence (the loop still completes within the same
outer 1s cycle, just with a shorter peak burst length).
Source
Adapted from
cplewes/microlink9f6af750(not cherry-picked — base has diverged too far). cplewes'soriginal commit message cites a specific incident (BLE-RPC notify pool
starvation on a long-uptime capture); this fork doesn't have that
downstream's BLE stack, so the comment here is adapted to reference our own
core/task assignment instead.
Related issues
Closes #24
Independent of #47/#48 — touches
ml_wg_mgr.conly, branched fresh offmain.Test plan
idf.py buildisn't runnable in this sandbox (no ESP-IDF installed).Manual check: confirmed
vTaskDelay(1)sits inside the per-peer loop body,at the top of each iteration (matches cplewes's placement — delays before
the first peer too, which is intentional and harmless). Needs hardware
re-test on a tailnet with enough peers to actually observe the starvation
this addresses; a 1-2 peer test tailnet won't exercise it.