Horizon repeating log messages when DEBUG=True

Bug #1182678 reported by Nicolas Simonds
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Nicolas Simonds
python-cinderclient
Fix Released
Undecided
Nicolas Simonds
python-keystoneclient
Fix Released
Medium
Nicolas Simonds
python-novaclient
Fix Released
Undecided
Nicolas Simonds

Bug Description

When setting DEBUG=True (i.e., in devstack and other development environments) we noticed that all the python-*client API calls would get logged multiple times. On high-traffic dev instances, it would be dozens of repeats for each log message. This made development work on these instances an experience somewhere on the scale between "hey, this is annoying" and "it's impossible to tell what's going on through all this noise"

Testing revealed that the problem seems to stem from different mod_wsgi processes/threads vivifying their own API client objects. The clients seem to blindly shove logging handlers into the list without looking to see if it's necessary to do so first, and this causes Horizon to have dozens of identical handlers for each log message, and it then does what you'd expect.

This isn't a problem with Horizon per se, but Horizon is affected by it. So far, we've observed the problem with novaclient, cinderclient and keystoneclient, but all the client libraries likely behave in the same fashion.

We also discovered in testing that there is no logging handler defined for cinderclient in the local_settings.py, so it uses the default hander.

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30004

Changed in horizon:
assignee: nobody → Nicolas Simonds (nicolas.simonds)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30005

Changed in python-cinderclient:
assignee: nobody → Nicolas Simonds (nicolas.simonds)
status: New → In Progress
Changed in python-novaclient:
assignee: nobody → Nicolas Simonds (nicolas.simonds)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30006

Changed in python-keystoneclient:
assignee: nobody → Nicolas Simonds (nicolas.simonds)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30007

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This likely affects all python-*client libraries and should be tested and expanded as needed.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/30007
Committed: http://github.com/openstack/python-keystoneclient/commit/de6f5120510c73ff4de376f5a361d1293f1d68a6
Submitter: Jenkins
Branch: master

commit de6f5120510c73ff4de376f5a361d1293f1d68a6
Author: Nicolas Simonds <email address hidden>
Date: Tue May 21 16:25:11 2013 -0700

    Only add logging handlers if there currently aren't any

    This corrects an odd problem where Horizon would stand up multiple
    client objects, which would cause duplicate/triplicate/dozens of
    repeated log lines in its log files, due to multiple identical
    handlers being added to the logging object

    Fixes Bug 1182678

    Change-Id: I020b3999c9008b996286ccb74a7801c96c43e71c

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/30004
Committed: http://github.com/openstack/horizon/commit/cda21fd594b3444337ccb96e427bb3c4a319cfd1
Submitter: Jenkins
Branch: master

commit cda21fd594b3444337ccb96e427bb3c4a319cfd1
Author: Nicolas Simonds <email address hidden>
Date: Tue May 21 16:00:07 2013 -0700

    Add a logging handler for the cinderclient to the local_settings.py.example

    This handles the Horizon piece of the API client logging wonderfulness

    Change-Id: Id2293898557b2fbbde092d8b67044482caf25c09
    Fixes: Bug 1182678

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/30006
Committed: http://github.com/openstack/python-novaclient/commit/e8e7a0e04fa6ced2e5a02a533d29a20d3014b4a8
Submitter: Jenkins
Branch: master

commit e8e7a0e04fa6ced2e5a02a533d29a20d3014b4a8
Author: Nicolas Simonds <email address hidden>
Date: Tue May 21 16:23:50 2013 -0700

    Only add logging handlers if there currently aren't any

    This corrects an odd problem where Horizon would stand up multiple
    client objects, which would cause duplicate/triplicate/dozens of
    repeated log lines in its log files, due to multiple identical
    handlers being added to the logging object

    Fixes Bug 1182678

    Change-Id: I1f3bae0a39f28412c99e5d04f4364611f2a5facb

Changed in python-novaclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/30005
Committed: http://github.com/openstack/python-cinderclient/commit/2a446c5b6bf0fa76c7e569e159362ec0d4cf2e6c
Submitter: Jenkins
Branch: master

commit 2a446c5b6bf0fa76c7e569e159362ec0d4cf2e6c
Author: Nicolas Simonds <email address hidden>
Date: Tue May 21 16:19:38 2013 -0700

    Only add logging handlers if there currently aren't any

    This corrects an odd problem where Horizon would stand up multiple
    client objects, which would cause duplicate/triplicate/dozens of
    repeated log lines in its log files, due to multiple identical
    handlers being added to the logging object

    Fixes Bug 1182678

    Change-Id: I198f3ecbb687bff69a06a166574b998cce54f2ac

Changed in python-cinderclient:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → havana-1
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: none → 0.2.4
status: Fix Committed → Fix Released
importance: Undecided → Medium
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This also affects python-quantumclient (same problem) with a slightly different manifestation (env variables, but again with no check to see if there is already a handler).

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

Apologies, I was mistaken, this will not affect python-quantumclient due to the location of logging instantiation.

no longer affects: python-quantumclient
Changed in python-novaclient:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-1 → 2013.2
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.