-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid future exception during setup of Synology DSM #118583
Avoid future exception during setup of Synology DSM #118583
Conversation
Hey there @hacf-fr, @Quentame, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
45861e8
to
b894f08
Compare
b894f08
to
1a9c068
Compare
If we don't resolve the future, I'm pretty sure every other coordinator will wait forever on the future if its also trying to relogin |
valid point, but i think we should not finished it with an exception, since during setup there will be no later task to wait for the future and consume the exception - those we get |
We can set it an than clear the flag instead so it doesn't raise when its gced example Line 181 in 32b51b8
|
uhhh great 👍 was looking for such a solution, but didn't find it 🙈 |
@@ -104,6 +104,9 @@ async def async_login(self) -> None: | |||
except BaseException as err: | |||
if not self._login_future.done(): | |||
self._login_future.set_exception(err) | |||
if during_setup: | |||
with suppress(BaseException): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should always suppress it since unless there is another execution at the same time it will also be un-retrieved. We should add a comment about why. It's the same reason as I linked above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean this way 0854a0f ?
Proposed change
SSIA
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: