Skip to content

Ensure services are removed from the registry when calling unregister_all_services#644

Merged
bdraco merged 3 commits into
python-zeroconf:masterfrom
bdraco:unregister_all_race
Jun 15, 2021
Merged

Ensure services are removed from the registry when calling unregister_all_services#644
bdraco merged 3 commits into
python-zeroconf:masterfrom
bdraco:unregister_all_race

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Jun 15, 2021

  • There was a race condition where a query could be answered for a service
    in the registry while goodbye packets which could result a fresh record
    being broadcast after the goodbye if a query came in at just the right
    time. To avoid this, we now remove the services from the registry right
    after we generate the goodbye packet

@bdraco bdraco changed the title Ensure services are removed from the registery when calling unregister_all_services Ensure services are removed from the registry when calling unregister_all_services Jun 15, 2021
@bdraco bdraco force-pushed the unregister_all_race branch 3 times, most recently from 589e7b9 to 4e65388 Compare June 15, 2021 17:50
@bdraco
Copy link
Copy Markdown
Member Author

bdraco commented Jun 15, 2021

There is a bug in the names test were we reuse service info and it gets mutated

…_all_services

- There was a race condition where a query could be answered for a service
  in the registry while goodbye packets which could result a fresh record
  being broadcast after the goodbye if a query came in at just the right
  time. To avoid this, we now remove the services from the registry right
  after we generate the goodbye packet
@bdraco bdraco force-pushed the unregister_all_race branch from 4e65388 to bce7a15 Compare June 15, 2021 18:12
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 15, 2021

Codecov Report

Merging #644 (02ae4b5) into master (a83d390) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #644      +/-   ##
==========================================
+ Coverage   96.38%   96.39%   +0.01%     
==========================================
  Files          17       17              
  Lines        2046     2054       +8     
  Branches      352      354       +2     
==========================================
+ Hits         1972     1980       +8     
  Misses         43       43              
  Partials       31       31              
Impacted Files Coverage Δ
zeroconf/_core.py 94.11% <100.00%> (+0.10%) ⬆️
zeroconf/_services/registry.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 a83d390...02ae4b5. Read the comment docs.

@bdraco bdraco merged commit cf0b5b9 into python-zeroconf:master Jun 15, 2021
@bdraco bdraco deleted the unregister_all_race branch June 15, 2021 18:45
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