Skip to content

ServiceBrowser must recheck for handlers to call when holding condition#477

Merged
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:handlers_to_call_sb_race
Jun 6, 2021
Merged

ServiceBrowser must recheck for handlers to call when holding condition#477
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:handlers_to_call_sb_race

Conversation

@bdraco

@bdraco bdraco commented Jun 6, 2021

Copy link
Copy Markdown
Member
  • There was a short race condition window where the ServiceBrowser
    could add to _handlers_to_call in the Engine thread, have the
    condition notify_all called, but since the ServiceBrowser was
    not yet holding the condition it would not know to stop waiting
    and process the handlers to call.

Fixes #476 for sync, #483 is the fix for async

Fixes #471

Comment thread zeroconf/__init__.py Outdated
- There was a short race condition window where the ServiceBrowser
  could add to _handlers_to_call in the Engine thread, have the
  condition notify_all called, but since the ServiceBrowser was
  not yet holding the condition it would not know to stop waiting
  and process the handlers to call.
@bdraco bdraco force-pushed the handlers_to_call_sb_race branch from 79f81fa to 43464a7 Compare June 6, 2021 23:06
bdraco added a commit to bdraco/python-zeroconf that referenced this pull request Jun 6, 2021
- Using a asyncio.Condition permits fixing a race condition
  in processing handlers similar to the sync version in python-zeroconf#477
@bdraco bdraco merged commit 8da00ca into python-zeroconf:master Jun 6, 2021
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #477 (43464a7) into master (b853413) will decrease coverage by 6.21%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #477      +/-   ##
==========================================
- Coverage   95.62%   89.40%   -6.22%     
==========================================
  Files           4        4              
  Lines        3338     3342       +4     
  Branches      402      400       -2     
==========================================
- Hits         3192     2988     -204     
- Misses         89      275     +186     
- Partials       57       79      +22     
Impacted Files Coverage Δ
zeroconf/__init__.py 89.02% <100.00%> (-3.00%) ⬇️
zeroconf/asyncio.py 97.45% <100.00%> (-1.28%) ⬇️
zeroconf/test.py 87.47% <100.00%> (-11.42%) ⬇️
zeroconf/test_asyncio.py 98.19% <0.00%> (-1.81%) ⬇️

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 849e9bc...43464a7. Read the comment docs.

@bdraco bdraco deleted the handlers_to_call_sb_race branch June 6, 2021 23:25
bdraco added a commit to bdraco/python-zeroconf that referenced this pull request Jun 7, 2021
- The root cause of the test failing should be fixed by python-zeroconf#419
  and python-zeroconf#477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants