Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mdns): supported removal of subtype when updating service (IDFGH-14413) #731

Merged

Conversation

tanyanquan
Copy link
Contributor

@tanyanquan tanyanquan commented Jan 13, 2025

This MR supports the updating of mdns services when subtypes are changing.

For example, if we start with a client which provides services _sub1,_sub2,_sub3,_sub4, and the client updates itself to now provide services _sub1,_sub5:

In the old implementation, the server only sends out a single new mdns packet with:

  • _sub1 (TTL = 120)
  • _sub5 (TTL = 120)

However, it is also important to send out a goodbye packet for:

  • _sub2 (TTL = 0)
  • _sub3 (TTL = 0)
  • _sub4 (TTL = 0)

This is similar to the behavior when entire services are removed, to ensure that subtypes are promptly updated as well.

Other tested scenarios include:

  • _sub1, _sub2 -> _sub3, _sub4
    • _sub1 and _sub2 (TTL = 0) mdns packet is sent out
  • _sub1, _sub2 -> no remaining subtypes
    • _sub1 and _sub2 (TTL = 0) mdns packet is sent out
  • no initial subtypes -> _sub3, _sub4
    • no extra packet is sent

heapdiag print has also been used to check for memory leaks, after performing multiple iterations of the above scenarios.

Moreover, any scheduled subtype answers will also be removed from their service to ensure that subsequent tx do not include false information about subtypes which have already been removed.

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2025

CLA assistant check
All committers have signed the CLA.

@tanyanquan tanyanquan marked this pull request as draft January 13, 2025 12:13
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 13, 2025
@github-actions github-actions bot changed the title feat(mdns): supported removal of subtype when updating service feat(mdns): supported removal of subtype when updating service (IDFGH-14413) Jan 13, 2025
@tanyanquan tanyanquan force-pushed the feat/update_subtype_removal branch 3 times, most recently from f31db06 to 541cef1 Compare January 14, 2025 12:40
@tanyanquan tanyanquan marked this pull request as ready for review January 14, 2025 12:42
@tanyanquan tanyanquan force-pushed the feat/update_subtype_removal branch 2 times, most recently from 9ec80e1 to ed86bb3 Compare January 15, 2025 02:40
@tanyanquan tanyanquan force-pushed the feat/update_subtype_removal branch 3 times, most recently from a6ae193 to 40ba06b Compare January 15, 2025 03:35
Copy link
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

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

LGTM, just a few nitpicks and questions

@tanyanquan tanyanquan force-pushed the feat/update_subtype_removal branch from 40ba06b to 4ad88e2 Compare January 16, 2025 02:57
@david-cermak david-cermak merged commit 265e38d into espressif:master Jan 20, 2025
79 checks passed
@tanyanquan tanyanquan deleted the feat/update_subtype_removal branch January 20, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants