-
-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Replace asyncio.wait with asyncio.gather since wait ignores exceptions #33380
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
Changes from 10 commits
de40b61
f649a7a
f48b612
265e616
f64a6c4
a226537
67f8738
d253ea0
c3ea753
fd3eab6
323e21f
9f62850
0934ac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,7 +128,7 @@ async def async_setup(self, config: ConfigType) -> None: | |
| tasks.append(self.async_setup_platform(p_type, p_config)) | ||
|
|
||
| if tasks: | ||
| await asyncio.wait(tasks) | ||
| await asyncio.gather(*tasks) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't want this, because we don't want setup of 1 platform cancel the others. The same with the change for reset. We still want to log them.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In all proposed changes here, it's ok to just log the errors and continue.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that makes sense, but brings up a few questions / suggestions:
What do you think is the best behavior? Maybe something like:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. just added the changes to _async_set_up_integrations |
||
|
|
||
| # Generic discovery listener for loading platform dynamically | ||
| # Refer to: homeassistant.components.discovery.load_platform() | ||
|
|
@@ -263,7 +263,7 @@ async def _async_reset(self) -> None: | |
| tasks.append(platform.async_destroy()) | ||
|
|
||
| if tasks: | ||
| await asyncio.wait(tasks) | ||
| await asyncio.gather(*tasks) | ||
|
|
||
| self._platforms = {self.domain: self._platforms[self.domain]} | ||
| self.config = None | ||
|
|
||
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.
The entity platform is already dealing with return value of
FalseThere 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.
ok, so just remove the log in that case?
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.
Yeah.
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.
fixed