fix: race with InvalidStateError when async_request times out by bdraco · Pull Request #1208 · python-zeroconf/python-zeroconf

@bdraco

…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 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

@bdraco

…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
```