* [patch] Improve error reporting in XenD
@ 2006-08-29 17:12 Daniel P. Berrange
2006-09-11 12:22 ` Daniel P. Berrange
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrange @ 2006-08-29 17:12 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]
In the XenD code which deals with dispatching of requests (SrvBase.py) the
dispatch process is obviously wrapped in a try/except block. Unfortunately
in the except block, the HTTP error code is never updated to indicate a failure
condition.
So, for example, if you try to create a domain requesting 3 GB of memory,
and Dom0 fails to balloon, XenD will happily still return 'HTTP 202 OK'
even though the domain creation failed. This leaves apps talking to XenD
no way to discover that there was a failure in the create operation, other
than telling the user to look in /var/log/xend.log where the details are
logged.
The attached patch sets the HTTP return code to '500 Internal Error' when
a request throws an exception. This lets client detect & report the failure
of domain creation immediately, improving the end user experiance
As an example user interaction with current behaviour. libvirt is told by
XenD that domain creation succeeded, so it goes onto to wait for devices
where upon its told there is no such domain:
Starting install...
libvir: Xen Daemon error : POST operation failed: No such domain demo12
Failed to get devices for domain demo12
With the attached patch applied, the initial domain creation failure can
be detected & reported immediately:
Starting install...
libvir: Xen Daemon error : POST operation failed: (xend.err 'Error creating domain: The privileged domain did not balloon!')
Failed to create domain demo12
Signed-off by: Daniel P. Berrange <berrange@redhat.com>
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[-- Attachment #2: xend-error-500.patch --]
[-- Type: text/plain, Size: 572 bytes --]
diff -r 68a1b61ecd28 tools/python/xen/web/SrvBase.py
--- a/tools/python/xen/web/SrvBase.py Mon Aug 28 13:08:41 2006 +0100
+++ b/tools/python/xen/web/SrvBase.py Tue Aug 29 12:54:28 2006 -0400
@@ -84,6 +84,7 @@ class SrvBase(resource.Resource):
try:
return op_method(op, req)
except Exception, exn:
+ req.setResponseCode(http.INTERNAL_SERVER_ERROR, "Request failed: " + op)
log.exception("Request %s failed.", op)
if req.useSxp():
return ['xend.err', str(exn)]
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Improve error reporting in XenD
2006-08-29 17:12 [patch] Improve error reporting in XenD Daniel P. Berrange
@ 2006-09-11 12:22 ` Daniel P. Berrange
2006-09-12 15:49 ` Alastair Tse
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrange @ 2006-09-11 12:22 UTC (permalink / raw)
To: xen-devel
I've not seen this patch appear in xen-unstable. Any chance that it can make
it into Xen 3.0.3 release. Its a really triival 1-liner which significantly
improves error handling when talking to XenD.
Regards,
Dan.
On Tue, Aug 29, 2006 at 06:12:22PM +0100, Daniel P. Berrange wrote:
> In the XenD code which deals with dispatching of requests (SrvBase.py) the
> dispatch process is obviously wrapped in a try/except block. Unfortunately
> in the except block, the HTTP error code is never updated to indicate a failure
> condition.
>
> So, for example, if you try to create a domain requesting 3 GB of memory,
> and Dom0 fails to balloon, XenD will happily still return 'HTTP 202 OK'
> even though the domain creation failed. This leaves apps talking to XenD
> no way to discover that there was a failure in the create operation, other
> than telling the user to look in /var/log/xend.log where the details are
> logged.
>
> The attached patch sets the HTTP return code to '500 Internal Error' when
> a request throws an exception. This lets client detect & report the failure
> of domain creation immediately, improving the end user experiance
>
> As an example user interaction with current behaviour. libvirt is told by
> XenD that domain creation succeeded, so it goes onto to wait for devices
> where upon its told there is no such domain:
>
> Starting install...
> libvir: Xen Daemon error : POST operation failed: No such domain demo12
> Failed to get devices for domain demo12
>
> With the attached patch applied, the initial domain creation failure can
> be detected & reported immediately:
>
> Starting install...
> libvir: Xen Daemon error : POST operation failed: (xend.err 'Error creating domain: The privileged domain did not balloon!')
> Failed to create domain demo12
>
>
> Signed-off by: Daniel P. Berrange <berrange@redhat.com>
>
>
> Regards,
> Dan.
> --
> |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
> |=- Perl modules: http://search.cpan.org/~danberr/ -=|
> |=- Projects: http://freshmeat.net/~danielpb/ -=|
> |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
> diff -r 68a1b61ecd28 tools/python/xen/web/SrvBase.py
> --- a/tools/python/xen/web/SrvBase.py Mon Aug 28 13:08:41 2006 +0100
> +++ b/tools/python/xen/web/SrvBase.py Tue Aug 29 12:54:28 2006 -0400
> @@ -84,6 +84,7 @@ class SrvBase(resource.Resource):
> try:
> return op_method(op, req)
> except Exception, exn:
> + req.setResponseCode(http.INTERNAL_SERVER_ERROR, "Request failed: " + op)
> log.exception("Request %s failed.", op)
> if req.useSxp():
> return ['xend.err', str(exn)]
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Improve error reporting in XenD
2006-09-11 12:22 ` Daniel P. Berrange
@ 2006-09-12 15:49 ` Alastair Tse
0 siblings, 0 replies; 3+ messages in thread
From: Alastair Tse @ 2006-09-12 15:49 UTC (permalink / raw)
To: xen-devel
Dan,
It's a pretty trivial patch and seems like a reasonable thing for the
HTTP server to do when it fails to create a domain.
I've applied the patch to xen-unstable.
Thanks,
Alastair
On Mon, 2006-09-11 at 13:22 +0100, Daniel P. Berrange wrote:
> I've not seen this patch appear in xen-unstable. Any chance that it can make
> it into Xen 3.0.3 release. Its a really triival 1-liner which significantly
> improves error handling when talking to XenD.
>
> Regards,
> Dan.
>
> On Tue, Aug 29, 2006 at 06:12:22PM +0100, Daniel P. Berrange wrote:
> > In the XenD code which deals with dispatching of requests (SrvBase.py) the
> > dispatch process is obviously wrapped in a try/except block. Unfortunately
> > in the except block, the HTTP error code is never updated to indicate a failure
> > condition.
> >
> > So, for example, if you try to create a domain requesting 3 GB of memory,
> > and Dom0 fails to balloon, XenD will happily still return 'HTTP 202 OK'
> > even though the domain creation failed. This leaves apps talking to XenD
> > no way to discover that there was a failure in the create operation, other
> > than telling the user to look in /var/log/xend.log where the details are
> > logged.
> >
> > The attached patch sets the HTTP return code to '500 Internal Error' when
> > a request throws an exception. This lets client detect & report the failure
> > of domain creation immediately, improving the end user experiance
> >
> > As an example user interaction with current behaviour. libvirt is told by
> > XenD that domain creation succeeded, so it goes onto to wait for devices
> > where upon its told there is no such domain:
> >
> > Starting install...
> > libvir: Xen Daemon error : POST operation failed: No such domain demo12
> > Failed to get devices for domain demo12
> >
> > With the attached patch applied, the initial domain creation failure can
> > be detected & reported immediately:
> >
> > Starting install...
> > libvir: Xen Daemon error : POST operation failed: (xend.err 'Error creating domain: The privileged domain did not balloon!')
> > Failed to create domain demo12
> >
> >
> > Signed-off by: Daniel P. Berrange <berrange@redhat.com>
> >
> >
> > Regards,
> > Dan.
> > --
> > |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
> > |=- Perl modules: http://search.cpan.org/~danberr/ -=|
> > |=- Projects: http://freshmeat.net/~danielpb/ -=|
> > |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
>
> > diff -r 68a1b61ecd28 tools/python/xen/web/SrvBase.py
> > --- a/tools/python/xen/web/SrvBase.py Mon Aug 28 13:08:41 2006 +0100
> > +++ b/tools/python/xen/web/SrvBase.py Tue Aug 29 12:54:28 2006 -0400
> > @@ -84,6 +84,7 @@ class SrvBase(resource.Resource):
> > try:
> > return op_method(op, req)
> > except Exception, exn:
> > + req.setResponseCode(http.INTERNAL_SERVER_ERROR, "Request failed: " + op)
> > log.exception("Request %s failed.", op)
> > if req.useSxp():
> > return ['xend.err', str(exn)]
>
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-12 15:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 17:12 [patch] Improve error reporting in XenD Daniel P. Berrange
2006-09-11 12:22 ` Daniel P. Berrange
2006-09-12 15:49 ` Alastair Tse
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.