From: John Snow Date: Thu, 23 Sep 2021 00:49:27 +0000 (-0400) Subject: python/aqmp: Reduce severity of EOFError-caused loop terminations X-Git-Tag: v6.2.0-rc0~59^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e55dc35b8ed8cea53ef2604874d2fe882fbadc1;p=thirdparty%2Fqemu.git 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 Reviewed-by: Paolo Bonzini Reviewed-by: Eric Blake Message-id: 20210923004938.3999963-7-jsnow@redhat.com Signed-off-by: John Snow --- diff --git a/python/qemu/aqmp/protocol.py b/python/qemu/aqmp/protocol.py index 32e78749c11..ae1df240260 100644 --- a/python/qemu/aqmp/protocol.py +++ b/python/qemu/aqmp/protocol.py @@ -721,8 +721,11 @@ class AsyncProtocol(Generic[T]): self.logger.debug("Task.%s: cancelled.", name) return except BaseException as err: - self.logger.error("Task.%s: %s", - name, exception_summary(err)) + self.logger.log( + logging.INFO if isinstance(err, EOFError) else logging.ERROR, + "Task.%s: %s", + name, exception_summary(err) + ) self.logger.debug("Task.%s: failure:\n%s\n", name, pretty_traceback()) self._schedule_disconnect()