Skip to content

fix: race with InvalidStateError when async_request times out#1208

Merged
bdraco merged 2 commits into
masterfrom
fix_race
Aug 3, 2023
Merged

fix: race with InvalidStateError when async_request times out#1208
bdraco merged 2 commits into
masterfrom
fix_race

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Aug 3, 2023

If async_request timed out at just the wrong time it could result in an InvalidStateError

2023-08-02 19:29:06.131 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Future.set_result(None)
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
asyncio.exceptions.InvalidStateError: invalid state

This was harmless but created noise

…es out

If async_request timed out at just the wrong time it could
result in an InvalidStateError

```
2023-08-02 19:29:06.131 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Future.set_result(None)
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
asyncio.exceptions.InvalidStateError: invalid state
```
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 3, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (126849c) 99.78% compared to head (80dd199) 99.78%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1208   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          22       22           
  Lines        2746     2749    +3     
  Branches      476      477    +1     
=======================================
+ Hits         2740     2743    +3     
  Misses          3        3           
  Partials        3        3           
Files Changed Coverage Δ
src/zeroconf/__init__.py 100.00% <100.00%> (ø)
src/zeroconf/_services/info.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco changed the title fix: resolve race with InvalidStateError error when async_request times out fix: race with InvalidStateError when async_request times out Aug 3, 2023
…es out

If async_request timed out at just the wrong time it could
result in an InvalidStateError

```
2023-08-02 19:29:06.131 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback Future.set_result(None)
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
asyncio.exceptions.InvalidStateError: invalid state
```
@bdraco bdraco merged commit 2233b6b into master Aug 3, 2023
@bdraco bdraco deleted the fix_race branch August 3, 2023 07:36
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.

1 participant