Merge lp:~openstack-gd/nova/lp708740 into lp:~hudson-openstack/nova/trunk

Proposed by Ilya Alekseyev
Status: Merged
Approved by: Soren Hansen
Approved revision: 640
Merged at revision: 642
Proposed branch: lp:~openstack-gd/nova/lp708740
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 22 lines (+7/-0)
1 file modified
nova/log.py (+7/-0)
To merge this branch: bzr merge lp:~openstack-gd/nova/lp708740
Reviewer Review Type Date Requested Status
Soren Hansen (community) gfe Approve
Vish Ishaya (community) Approve
Thierry Carrez (community) gfe Needs Information
Eldar Nugaev (community) Approve
Todd Willey Pending
Review via email: mp+47838@code.launchpad.net

Description of the change

Changed default handler for uncaughted exceptions. It uses logging instead print to stderr.

To post a comment you must log in.
Revision history for this message
Eldar Nugaev (reldan) wrote :

lgtm

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

That sounds like a pretty serious change in behavior to push 2 days before carving a release candidate. Could you explain to me why this needs to be pushed in Bexar ? I see that the regression risk is contained, however it changes the behavior of the software a bit too deeply, a bit too late.

review: Needs Information (gfe)
Revision history for this message
Andrey Brindeyev (abrindeyev) wrote :

> That sounds like a pretty serious change in behavior to push 2 days before
> carving a release candidate. Could you explain to me why this needs to be
> pushed in Bexar ? I see that the regression risk is contained, however it
> changes the behavior of the software a bit too deeply, a bit too late.

Thierry,

I already discussed that with Soren on IRC last Friday.
With current code we are loosing Python TRACEs (and all other data which Nova sents to STDOUT and STDERR) when Nova daemons properly daemonized.
See bug for details: https://bugs.launchpad.net/nova/+bug/708740

Nova daemon's startup scripts in Ubuntu needs to be slightly modified to run with our code:
s, > /var/log/nova/nova-compute.log,--logfile /var/log/nova/nova-compute.log,

Revision history for this message
Thierry Carrez (ttx) wrote :

Note that I don't deny the existence of a bug, I'm just trying to see if that's a bug we can release with or one that justifies a late exception.

If all it affects is currently-non-existent packaging that would make proper use of daemonization, then I don't think it's worth it. That work-in-progress packaging could even carry the necessary patch.

That said, it looks rather contained, and Soren can probably sync the fixing of Ubuntu packaging so that this does not break it. If you can get two nova-core approvals today on this one saying it's harmless, I won't oppose it.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

I definitely would prefer to have no exceptions getting eaten. It makes debugging user issues a lot more difficult.
On Jan 31, 2011, at 5:44 AM, Thierry Carrez wrote:

> Note that I don't deny the existence of a bug, I'm just trying to see if that's a bug we can release with or one that justifies a late exception.
>
> If all it affects is currently-non-existent packaging that would make proper use of daemonization, then I don't think it's worth it. That work-in-progress packaging could even carry the necessary patch.
>
> That said, it looks rather contained, and Soren can probably sync the fixing of Ubuntu packaging so that this does not break it. If you can get two nova-core approvals today on this one saying it's harmless, I won't oppose it.
> --
> https://code.launchpad.net/~openstack-gd/nova/lp708740/+merge/47838
> You are subscribed to branch lp:nova.

Revision history for this message
Vish Ishaya (vishvananda) :
review: Approve
Revision history for this message
Soren Hansen (soren) wrote :

This looks:

a) correct,
b) benign,
b) last, but not least importantly, easily revertible.

Let's do it.

review: Approve
Revision history for this message
Soren Hansen (soren) wrote :

Got approval from Thierry by phone (he's traveling right now).

review: Approve (gfe)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/log.py'
2--- nova/log.py 2011-01-20 14:12:02 +0000
3+++ nova/log.py 2011-01-28 17:52:54 +0000
4@@ -31,6 +31,7 @@
5 import json
6 import logging
7 import logging.handlers
8+import sys
9 import traceback
10
11 from nova import flags
12@@ -191,6 +192,12 @@
13 kwargs.pop('exc_info')
14 self.error(message, **kwargs)
15
16+
17+def handle_exception(type, value, tb):
18+ logging.root.critical(str(value), exc_info=(type, value, tb))
19+
20+
21+sys.excepthook = handle_exception
22 logging.setLoggerClass(NovaLogger)
23
24