1
mirror of https://github.com/home-assistant/supervisor synced 2024-08-05 03:49:58 +02:00

Handle EOFError with dbus-next (#3246)

This commit is contained in:
Pascal Vizeli 2021-10-20 11:37:44 +02:00 committed by GitHub
parent 36ea8b2bb4
commit f864613ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,13 +90,22 @@ class DBus:
except Exception as err: except Exception as err:
raise DBusFatalError() from err raise DBusFatalError() from err
try: for _ in range(3):
introspection = await self._bus.introspect( try:
self.bus_name, self.object_path, timeout=10 introspection = await self._bus.introspect(
) self.bus_name, self.object_path, timeout=10
except InvalidIntrospectionError as err: )
_LOGGER.error("Can't parse introspect data: %s", err) except InvalidIntrospectionError as err:
raise DBusParseError() from err _LOGGER.error("Can't parse introspect data: %s", err)
raise DBusParseError() from err
except EOFError:
_LOGGER.warning(
"Busy system at %s - %s", self.bus_name, self.object_path
)
else:
break
await asyncio.sleep(3)
self._add_interfaces(introspection) self._add_interfaces(introspection)