Skip to content

Set stale unique records to expire 1s in the future instead of instant removal#706

Merged
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:expire_records_instead_of_delete
Jun 17, 2021
Merged

Set stale unique records to expire 1s in the future instead of instant removal#706
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:expire_records_instead_of_delete

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Jun 17, 2021

  • Fixes Cache flush happens too quickly #475

  • https://tools.ietf.org/html/rfc6762#section-10.2
    Queriers receiving a Multicast DNS response with a TTL of zero SHOULD
    NOT immediately delete the record from the cache, but instead record
    a TTL of 1 and then delete the record one second later. In the case
    of multiple Multicast DNS responders on the network described in
    Section 6.6 above, if one of the responders shuts down and
    incorrectly sends goodbye packets for its records, it gives the other
    cooperating responders one second to send out their own response to
    "rescue" the records before they expire and are deleted.

@bdraco bdraco force-pushed the expire_records_instead_of_delete branch from 59bee23 to f1e3aa8 Compare June 17, 2021 19:56
…t removal

- Fixes python-zeroconf#475

- https://tools.ietf.org/html/rfc6762#section-10.2
  Queriers receiving a Multicast DNS response with a TTL of zero SHOULD
  NOT immediately delete the record from the cache, but instead record
  a TTL of 1 and then delete the record one second later.  In the case
  of multiple Multicast DNS responders on the network described in
  Section 6.6 above, if one of the responders shuts down and
  incorrectly sends goodbye packets for its records, it gives the other
  cooperating responders one second to send out their own response to
  "rescue" the records before they expire and are deleted.
@bdraco bdraco force-pushed the expire_records_instead_of_delete branch from f1e3aa8 to 13b66aa Compare June 17, 2021 20:10
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 17, 2021

Codecov Report

Merging #706 (13b66aa) into master (f39bde0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #706   +/-   ##
=======================================
  Coverage   98.24%   98.24%           
=======================================
  Files          18       18           
  Lines        2161     2161           
  Branches      376      376           
=======================================
  Hits         2123     2123           
  Misses         23       23           
  Partials       15       15           
Impacted Files Coverage Δ
zeroconf/_dns.py 100.00% <100.00%> (ø)
zeroconf/_handlers.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f39bde0...13b66aa. Read the comment docs.

@bdraco bdraco merged commit f3eeecd into python-zeroconf:master Jun 17, 2021
@bdraco bdraco deleted the expire_records_instead_of_delete branch June 17, 2021 20:42
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.

Cache flush happens too quickly

2 participants