Skip to content

Exponential backoff of mdns service resolution retries#268

Merged
balloob merged 3 commits into
home-assistant-libs:masterfrom
emontnemery:mdns_backoff
Feb 15, 2019
Merged

Exponential backoff of mdns service resolution retries#268
balloob merged 3 commits into
home-assistant-libs:masterfrom
emontnemery:mdns_backoff

Conversation

@emontnemery
Copy link
Copy Markdown
Collaborator

@emontnemery emontnemery commented Feb 15, 2019

Exponential backoff of mdns service resolution retries since each resolution request may generate a large number of packets with detrimental side effects.

Also:

  • Connect to IP, if known, instead of to host in case mdns name resolution is not enabled
  • Improve debug prints to include friendly name if known

See home-assistant/core#21075

@emontnemery emontnemery force-pushed the mdns_backoff branch 4 times, most recently from 561125c to 6e87f11 Compare February 15, 2019 15:05
# Resolve the service name. If service is None, we're
# connecting directly to a host name or IP-address
if service:
if now < retry['next_retry']:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why check this here instead of before creating a new socket and outside of the try?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, you're right.. Will fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants