Skip to content

Fix cache handling of records with different TTLs#729

Merged
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:fix_cache_conflict
Jun 18, 2021
Merged

Fix cache handling of records with different TTLs#729
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:fix_cache_conflict

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Jun 18, 2021

  • There should only be one unique record in the cache at
    a time as having multiple unique records will different
    TTLs in the cache can result in unexpected behavior since
    some functions returned all matching records and some
    fetched from the right side of the list to return the
    newest record. Intead we now store the records in a dict
    to ensure that the newest record always replaces the same
    unique record and we never have a source of truth problem
    determining the TTL of a record from the cache.

- There should only be one unique record in the cache at
  a time as having multiple unique records will different
  TTLs in the cache can result in unexpected behavior since
  some functions returned all matching records and some
  fetched from the right side of the list to return the
  newest record. Intead we now store the records in a dict
  to ensure that the newest record always replaces the same
  unique record and we never have a source of truth problem
  determining the TTL of a record from the cache.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 18, 2021

Codecov Report

Merging #729 (e4be118) into master (ceb79bd) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #729      +/-   ##
==========================================
- Coverage   98.20%   98.20%   -0.01%     
==========================================
  Files          18       18              
  Lines        2171     2168       -3     
  Branches      377      377              
==========================================
- Hits         2132     2129       -3     
  Misses         25       25              
  Partials       14       14              
Impacted Files Coverage Δ
zeroconf/_cache.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 ceb79bd...e4be118. Read the comment docs.

@bdraco bdraco merged commit 88aa610 into python-zeroconf:master Jun 18, 2021
@bdraco bdraco deleted the fix_cache_conflict branch June 18, 2021 22:14
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