Skip to content

AsyncServiceBrowser must recheck for handlers to call when holding condition#483

Merged
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:handlers_to_call_race_async
Jun 7, 2021
Merged

AsyncServiceBrowser must recheck for handlers to call when holding condition#483
bdraco merged 1 commit into
python-zeroconf:masterfrom
bdraco:handlers_to_call_race_async

Conversation

@bdraco

@bdraco bdraco commented Jun 6, 2021

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

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

Fixes #471

@codecov-commenter

codecov-commenter commented Jun 6, 2021

Copy link
Copy Markdown

Codecov Report

Merging #483 (12e8365) into master (393910b) will decrease coverage by 0.14%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
- Coverage   95.73%   95.58%   -0.15%     
==========================================
  Files           4        4              
  Lines        3375     3377       +2     
  Branches      408      409       +1     
==========================================
- Hits         3231     3228       -3     
- Misses         86       90       +4     
- Partials       58       59       +1     
Impacted Files Coverage Δ
zeroconf/asyncio.py 98.88% <80.00%> (+0.55%) ⬆️
zeroconf/__init__.py 91.91% <92.30%> (-0.36%) ⬇️

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 393910b...12e8365. Read the comment docs.

@bdraco bdraco force-pushed the handlers_to_call_race_async branch 2 times, most recently from 3d6ef09 to 12e8365 Compare June 6, 2021 23:49
@bdraco

bdraco commented Jun 6, 2021

Copy link
Copy Markdown
Member Author

The time calculation can be broken out into a separate function

Opened #484 for that

…ndition

- There was a short race condition window where the AsyncServiceBrowser
  could add to _handlers_to_call in the Engine thread, have the
  condition notify_all called, but since the AsyncServiceBrowser 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_race_async branch from 12e8365 to c797648 Compare June 7, 2021 00:05
@bdraco bdraco merged commit 9606936 into python-zeroconf:master Jun 7, 2021
@bdraco bdraco deleted the handlers_to_call_race_async branch June 7, 2021 00: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

2 participants