mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 08:06:30 +00:00
Stop streaming logs when client closes connection (#5722)
When connection is closed by the client, the journal_logs_reader generator still returns new lines, trying to write each one of them to the closed transport. With debug logging enabled, this can end up in an endless loop. To fix that, break out of the loop immediately after the connection is reset.
This commit is contained in:
parent
fdd96ae21c
commit
8fb66bcf18
@ -270,6 +270,7 @@ class APIHost(CoreSysAttributes):
|
|||||||
"ClientConnectionResetError raised when returning journal logs: %s",
|
"ClientConnectionResetError raised when returning journal logs: %s",
|
||||||
err,
|
err,
|
||||||
)
|
)
|
||||||
|
break
|
||||||
except ConnectionResetError as ex:
|
except ConnectionResetError as ex:
|
||||||
raise APIError(
|
raise APIError(
|
||||||
"Connection reset when trying to fetch data from systemd-journald."
|
"Connection reset when trying to fetch data from systemd-journald."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user