Skip to content

Commit 3e55dc3

Browse files
committed
python/aqmp: Reduce severity of EOFError-caused loop terminations
When we encounter an EOFError, we don't know if it's an "error" in the perspective of the user of the library yet. Therefore, we should not log it as an error. Reduce the severity of this logging message to "INFO" to indicate that it's something that we expect to occur during the normal operation of the library. Signed-off-by: John Snow <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Eric Blake <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]>
1 parent 58026b1 commit 3e55dc3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/qemu/aqmp/protocol.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,11 @@ async def _bh_loop_forever(self, async_fn: _TaskFN, name: str) -> None:
721721
self.logger.debug("Task.%s: cancelled.", name)
722722
return
723723
except BaseException as err:
724-
self.logger.error("Task.%s: %s",
725-
name, exception_summary(err))
724+
self.logger.log(
725+
logging.INFO if isinstance(err, EOFError) else logging.ERROR,
726+
"Task.%s: %s",
727+
name, exception_summary(err)
728+
)
726729
self.logger.debug("Task.%s: failure:\n%s\n",
727730
name, pretty_traceback())
728731
self._schedule_disconnect()

0 commit comments

Comments
 (0)