qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [RFC] Fixing the error failure
Date: Mon, 02 Jul 2012 07:47:56 -0500	[thread overview]
Message-ID: <4FF1987C.8010304@codemonkey.ws> (raw)
In-Reply-To: <m3txxvq3i3.fsf@blackfin.pond.sub.org>

On 06/28/2012 02:50 AM, Markus Armbruster wrote:
> Anthony Liguori<anthony@codemonkey.ws>  writes:
>
>> On 06/26/2012 06:21 AM, Markus Armbruster wrote:
>>> "Daniel P. Berrange"<berrange@redhat.com>   writes:
>>>
>>>> On Tue, Jun 26, 2012 at 09:54:21AM +0200, Markus Armbruster wrote:
>>>>> Luiz Capitulino<lcapitulino@redhat.com>   writes:
>>>>>
>>>>>> On Thu, 21 Jun 2012 13:42:19 +0100
>>>>>> "Daniel P. Berrange"<berrange@redhat.com>   wrote:
>>> [...]
>>>>>>> In libvirt we have always reserved the right to change the error
>>>>>>> code reported for particular scenarios. So, for example, alot of
>>>>>>> our errors started out as "InternalError" (equiv to UndefinedError)
>>>>>>> but over time we have changed some to more specialized values
>>>>>>> eg "InvalidOperation", "ConfigNotSupported" and so on.
>>>>>
>>>>> Do you reserve the right to make changes other than from InternalError
>>>>> to a more specific one?
>>>>
>>>> If I'm perfectly honest, then yes. We have tried not to gratuitouslyy
>>>> change errors being reported, but they have definitely evolved over
>>>> time, so more distinct error scenarios are reported, where previously
>>>> many things would have been lumped under one code.
>>>
>>> Pragmatic co-evolution of errors with their actual use.  Makes sense to
>>> me, and I'd recommend we do the same in QEMU.
>>
>> Just to be clear, what we're discussing is:
>>
>>> diff --git a/qerror.c b/qerror.c
>>> index 92c4eff..ebe2eb0 100644
>>> --- a/qerror.c
>>> +++ b/qerror.c
>>> @@ -328,6 +328,10 @@ static const QErrorStringTable qerror_table[] = {
>>>           .error_fmt = QERR_SOCKET_CREATE_FAILED,
>>>           .desc      = "Failed to create socket",
>>>       },
>>> +    {
>>> +        .error_fmt = QERR_UNDEFINED_ERROR,
>>> +        .desc      = "Undefined Error: %(message)",
>>> +    },
>>>       {}
>>>   };
>>>
>>> diff --git a/qerror.h b/qerror.h
>>> index b4c8758..da8f086 100644
>>> --- a/qerror.h
>>> +++ b/qerror.h
>>> @@ -266,4 +266,7 @@ QError *qobject_to_qerror(const QObject *obj);
>>>   #define QERR_SOCKET_CREATE_FAILED \
>>>       "{ 'class': 'SockCreateFailed', 'data': {} }"
>>>
>>> +#define QERR_UNDEFINED_ERROR \
>>> +    "{ 'class': 'UndefinedError', 'data': { 'message': %s } }"
>>> +
>>>   #endif /* QERROR_H */
>>
>> Nothing more, nothing less.  No changes to wire protocol, no changes
>> to existing error uses, etc.
>
> What we're discussing is whatever people bring up, actually.
>
> So far, there haven't been any calls for a change of the wire protocol.

Changing all existing errors and repurposing 'desc' is effectively changing the 
wire protocol.

>
> There has been an agreement of sorts that the current "rich errors" have
> been "a failure" (your words).  Doesn't mean we all agree on the nature
> of the failure.
>
> Several people pointed out that:
>
> * our "rich" errors are so cumbersome to emit that adoption has been
>    slow,
>
> * our "rich" errors' human-readable descriptions lead to piss-poor
>    human-readable error messages[*] (pardon my french), and
>
> * the "richness" has no known uses after 2+ years.

Do you know of *any* QMP user beyond libvirt?  Let's face it, QMP is a protocol 
for libvirt.  What it looks like shouldn't be dictated by anything other than 
what libvirt wants/needs.

If libvirt isn't going to do more than look at an error type, then there's no 
point in providing more than that.

> Perhaps your idea of the rich errors failure stops at the first item
> (slow adoption).  Perhaps you even entertain hopes of solving the
> adoption problem by first asking for adoption of "simplified rich
> errors", and once that's done, push again for your original design.
>
> I disagree with both notions.
>
> Slow adoption is a *symptom*, not a cause: it's been slow, because the
> costs and drawbacks outweigh the benefits.  In other words, it's been
> slow, because people have had the good sense not to do something that's
> plainly not worth it.
>
> I agree converting existing uses of the failed rich errors API to
> whatever new API we come up with before anything else isn't useful.
>
> But I challenge the idea that we must not change existing uses of "rich"
> error reporting ever.

I think you're missing the forest for the trees.

The real problem we need to solve is not the quality of error messages. 
Honestly, we have all of the tools today to improve error messages.

The problem we need to solve is error propagation because without it, we cannot 
have asynchronous commands.  We keep ending up with extremely complex/cumbersome 
management interfaces that we need to support forever because we still have 
out-of-band errors that cannot be associated with a specific QMP command.

So I don't want to see us focus a bunch of effort on rewriting existing error 
users.  Is that a hard and fast rule?  Of course not.  If it makes sense to 
tweak an error here and there, that's fine.

But the problem to solve is killing off error_report.

Regards,

Anthony Liguori

   When such a use produces bad human-readable
> messages, that's a bug, and the most expedient fix could well be a
> switch to the new, saner API, even when that drops a bit of the richness
> (which after all has no known uses).
>
> For me, known suffering of human users weighs more heavily than
> hypothetical suffering of hypothetical tools.
>
>
> [*] This is why I refuse to work on error conversions.  Turning decent
> error messages into garbage is just too frustrating for me.  Yes, my
> life would be easier if I didn't care for users.

  parent reply	other threads:[~2012-07-02 12:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1338387301-10074-1-git-send-email-lcapitulino@redhat.com>
     [not found] ` <1338387301-10074-3-git-send-email-lcapitulino@redhat.com>
     [not found]   ` <4FC74B1A.8080700@redhat.com>
     [not found]     ` <20120531110608.4dc3fe22@doriath.home>
     [not found]       ` <4FC77F6C.8000008@redhat.com>
     [not found]         ` <20120531113127.1c8aa213@doriath.home>
     [not found]           ` <4FC78637.4040605@redhat.com>
     [not found]             ` <20120531124411.659ed161@doriath.home>
     [not found]               ` <4FC79316.6080603@redhat.com>
     [not found]                 ` <20120531130814.5779aae9@doriath.home>
2012-06-01 12:40                   ` [Qemu-devel] [PATCH 02/14] qerror: add new errors Kevin Wolf
2012-06-13 17:49             ` [Qemu-devel] Adding errno to QMP errors Luiz Capitulino
2012-06-15 14:46               ` Luiz Capitulino
2012-06-15 16:52               ` Anthony Liguori
2012-06-15 16:55                 ` Paolo Bonzini
2012-06-15 17:48                   ` Anthony Liguori
2012-06-15 19:11                     ` Paolo Bonzini
2012-06-15 17:02                 ` Luiz Capitulino
2012-06-15 17:23                   ` Kevin Wolf
2012-06-15 17:03                 ` Daniel P. Berrange
2012-06-18 15:41                   ` Markus Armbruster
2012-06-18 18:31                     ` Anthony Liguori
2012-06-19  7:39                       ` Kevin Wolf
2012-06-19  9:20                         ` Daniel P. Berrange
2012-06-19  9:31                           ` Kevin Wolf
2012-06-19 13:12                       ` Luiz Capitulino
2012-06-20 17:48                         ` [Qemu-devel] [RFC] Fixing the error failure Luiz Capitulino
2012-06-20 18:46                           ` Anthony Liguori
2012-06-20 19:40                             ` Luiz Capitulino
2012-06-20 19:47                               ` Anthony Liguori
2012-06-20 20:13                                 ` Luiz Capitulino
2012-06-21 12:42                           ` Daniel P. Berrange
     [not found]                             ` <20120625165651.31f9e0bd@doriath.home>
     [not found]                               ` <m34npyld8y.fsf@blackfin.pond.sub.org>
     [not found]                                 ` <20120626093511.GD14451@redhat.com>
     [not found]                                   ` <m3hatyco9g.fsf@blackfin.pond.sub.org>
     [not found]                                     ` <4FE9E275.40303@codemonkey.ws>
     [not found]                                       ` <m3txxvq3i3.fsf@blackfin.pond.sub.org>
2012-07-02 12:47                                         ` Anthony Liguori [this message]
2012-07-02 13:47                                           ` Luiz Capitulino
2012-07-02  8:03                           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FF1987C.8010304@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).