Skip to content

mDNS responder stops answering after serial contact when an mdns.Server exists (web workflow enabled) #51

Description

@mikeysklar

With the web workflow enabled, serial/REPL contact kills the mDNS responder until reboot. HTTP and ICMP usually survive. No user code, no advertise_service(), and nothing running to interrupt.

The trigger is the presence of an mdns.Server object, which the web workflow always constructs. Boards without it are unaffected.

Evidence

Two-arm test, arms alternated, criterion declared before the first reset, both metrics on one socket, replies classified by record type and by destination address.

arm cyc | base_A post_A | post_P | http | KbdInt
A    1  | 3/4    4/4    | 0/1    | 200  | False
B    2  | 4/4    0/4    | 0/1    | 200  | False
A    3  | 4/4    3/4    | 0/1    | 200  | False
B    4  | 4/4    0/4    | 0/1    | 200  | False
A    5  | 3/4    4/4    | 0/1    | 200  | False
B    6  | 3/4    0/4    | 0/1    | 000  | False
A    7  | 4/4    4/4    | 0/1    | 200  | False
B    8  | 4/4    0/4    | 0/1    | 200  | False
A    9  | 4/4    3/4    | 0/1    | 200  | False
B   10  | 4/4    0/4    | 0/1    | 200  | False

arm A hostname post: [4,3,4,4,3]   5/5 valid
arm B hostname post: [0,0,0,0,0]   5/5 valid
all 55 answers multicast, zero unicast

KbdInt is False in every arm-B cycle. code.py was print("Hello World!"), which finishes before the Ctrl-C arrives, so there was no KeyboardInterrupt and no running program to interrupt. mDNS died anyway, five times out of five.

Cycle 6 also lost HTTP (000) while the other four arm-B cycles kept 200, so the effect is usually mDNS-only but not always. One occurrence in five; noted, not explained.

Why every earlier cross-board comparison was misleading

One board ran the web workflow and reproduced; the other had no CIRCUITPY_WEB_API_PASSWORD, therefore no web workflow, therefore no mdns.Server was ever constructed, and did not reproduce. Adding the password to the second board made it reproduce on demand.

That reconciles every result in this thread without appealing to silicon, access points, host OS, toolchain or the Zephyr pin — all of which were investigated and none of which was the difference.

Related, and visible throughout

post_P is 0/1 in all ten cycles, including every healthy control. Services never publish even when the responder is demonstrably answering hostname queries. That is the separate DNS-SD bug, and it is why a service-discovery probe cannot be used as an mDNS health check here.

Mechanism: still not established

Six candidate mechanisms have been proposed and retired by measurement rather than argument:

  1. BLE adapter teardown
  2. advertise_service()
  3. The per-object record array in common-hal/mdns/Server.c
  4. The Zephyr stack-allocated listener poll arrays (fixed upstream, tracked separately)
  5. Interrupting a running program, as a sufficient condition
  6. The upstream mDNS commit as the differentiator

What is established: with an mdns.Server present, serial contact kills mDNS responses until reboot; without one, it does not. The mdns_responder_set_ext_records() replace-not-append behaviour remains the most plausible surviving lead, since it is the one path that ties an mdns.Server object to the responder's record state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingport:siwx917SiWx917 CircuitPython port

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions