Skip to content

fix(mdns): Create static task only when SPIRAM-task-alloc is ON - #1110

Open
david-cermak wants to merge 2 commits into
espressif:masterfrom
david-cermak:feat/mdns_mem_reduce_config
Open

fix(mdns): Create static task only when SPIRAM-task-alloc is ON#1110
david-cermak wants to merge 2 commits into
espressif:masterfrom
david-cermak:feat/mdns_mem_reduce_config

Conversation

@david-cermak

@david-cermak david-cermak commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Partially addresses #1100


Note

Medium Risk
Touches core mDNS task lifecycle and compile-time removal of browse paths; misconfiguration could break apps that call browse APIs with browse disabled.

Overview
Adds CONFIG_MDNS_ENABLE_BROWSE (default on) so continuous browse (mdns_browse_new / related RX, netif, console, and mdns_browser.c) can be stripped for ~3–4 KB flash when only advertise or one-shot queries are needed. Public browse APIs and browse CLI commands are wrapped in the same guard; CI builds sdkconfig.build_only.no_browse via new sdkconfig.build_only.* steps in the mdns workflow.

Separately, the mDNS service task now uses xTaskCreatePinnedToCore when the stack stays on internal RAM and CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM is off; xTaskCreateStaticPinnedToCore with caps-allocated stack is kept for SPIRAM task creation or when external task memory is allowed. Stack free on deinit follows that split.

Reviewed by Cursor Bugbot for commit 05e7e4f. Bugbot is set up for automated code reviews on this repo. Configure here.

@david-cermak david-cermak self-assigned this Jul 24, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 030b9c5. Configure here.

Comment thread components/mdns/mdns_service.c Outdated
@david-cermak
david-cermak force-pushed the feat/mdns_mem_reduce_config branch from 030b9c5 to 063b1d9 Compare July 24, 2026 11:17
* only one browse is synchronized for that packet. This should not affect
* typical browse traffic, where packets answer one service type.
*
* @note Requires CONFIG_MDNS_ENABLE_BROWSE=y.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is enabled by default, I would phrase it as Can be disabled by ...

set(MDNS_MEMORY "mdns_mem_caps.c")

set(MDNS_CORE "mdns_responder.c" "mdns_receive.c" "mdns_utils.c" "mdns_debug.c" "mdns_browser.c" "mdns_send.c" "mdns_netif.c"
if(CONFIG_MDNS_ENABLE_BROWSE)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Append after is cleaner

@zwx1995esp

Copy link
Copy Markdown
Collaborator

Hi @david-cermak I think there is a function mdns_debug_printf_browse_result in the file mdns_debug.c which also should be surrounded by the macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants