Panko dispatcher and publisher should not setup oslo_log again

Bug #1666174 reported by Gautam Prasad
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Panko
Fix Released
Undecided
Unassigned

Bug Description

There seems to be a bug w.r.t. logging when configuring panko dispatcher at Ceilometer. When Ceilometer collector loads the Panko database dispatcher, the Panko database dispatcher calls the below API

conf = service.prepare_service([])

As part of this, the following call is made:
log.setup(conf, 'panko')

This probably causes the logger to switch to /var/log/panko. I had to touch ceilometer-collector.log in /var/log/panko to get the rest of the logs

When ceilometer-collector starts, it logs the below:

2017-02-20 04:40:06.589 19410 DEBUG cotyledon.oslo_config_glue [-] publisher_notifier.telemetry_driver = messagingv2 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2732
2017-02-20 04:40:06.590 19410 DEBUG cotyledon.oslo_config_glue [-] ******************************************************************************** log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2734
2017-02-20 04:40:06.594 19419 DEBUG ceilometer.dispatcher [-] loading dispatchers from ceilometer.dispatcher.meter _load_dispatcher_manager /usr/lib/python2.7/site-packages/ceilometer/dispatcher/__init__.py:56
2017-02-20 04:40:06.597 19419 DEBUG ceilometer.dispatcher [-] loading dispatchers from ceilometer.dispatcher.event _load_dispatcher_manager /usr/lib/python2.7/site-packages/ceilometer/dispatcher/__init__.py:56

Then the rest of the logging switches over to /var/log/panko/ceilometer-collector.log

[root panko]# head -10 ceilometer-collector.log

2017-02-20 04:40:06.751 19419 DEBUG panko.storage [-] looking for 'mysql' driver in panko.storage get_connection /usr/lib/python2.7/site-packages/panko/storage/__init__.py:84
2017-02-20 04:40:06.866 19419 DEBUG cotyledon.oslo_config_glue [-] Full set of CONF: _load_service_options /usr/lib/python2.7/site-packages/cotyledon/oslo_config_glue.py:48
2017-02-20 04:40:06.866 19419 DEBUG cotyledon.oslo_config_glue [-] ******************************************************************************** log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2710
2017-02-20 04:40:06.866 19419 DEBUG cotyledon.oslo_config_glue [-] Configuration options gathered from: log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2711

Revision history for this message
Gautam Prasad (gautpras) wrote :

It seems that until I create the log file /var/log/panko/ceilometer-collector.log, the collector process does not write to database about events. So this not only affect writing logs to log file, but affects the functionality of putting events to database as well.

Revision history for this message
Gautam Prasad (gautpras) wrote :

I suspect that same will be the case when configuring Panko publisher from ceilometer notification process.

summary: - Logging switched over to panko from ceilometer collector
+ Panko dispatcher and publisher should not setup oslo_log again
Revision history for this message
György Szombathelyi (gyurco) wrote :

Another issue with this: if the ceilometer user cannot write to /var/log/panko, the collector just silently sits and doesn't consume events from the queue.

Revision history for this message
György Szombathelyi (gyurco) wrote :

Ah I see you already mentioned nearly the same as #3 in #1.

Revision history for this message
gordon chung (chungg) wrote :

no idea if the proposed patch works. please feel free to try it and provide feedback.

Revision history for this message
gordon chung (chungg) wrote :
Revision history for this message
Julien Danjou (jdanjou) wrote :

I tried the patch and it works fine here.

Revision history for this message
Gautam Prasad (gautpras) wrote :

Yes. The dispatcher works fine with the patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to panko (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/439607

Changed in panko:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to panko (master)

Reviewed: https://review.openstack.org/439064
Committed: https://git.openstack.org/cgit/openstack/panko/commit/?id=3fbfd60e45c10c18d1a662e64495f564443e43b2
Submitter: Jenkins
Branch: master

commit 3fbfd60e45c10c18d1a662e64495f564443e43b2
Author: gord chung <email address hidden>
Date: Tue Feb 28 12:17:25 2017 -0500

    don't setup logging or cors when not needed

    publisher/dispatcher are used by ceilometer which already has logging
    set up. don't do it again.

    Change-Id: I13ec9797b2794f910b55adbc70d47892ce4cdddf
    Closes-Bug: #1666174

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to panko (stable/ocata)

Reviewed: https://review.openstack.org/439607
Committed: https://git.openstack.org/cgit/openstack/panko/commit/?id=9a9ae04a86bf418a6f1eb196a737f45160769445
Submitter: Jenkins
Branch: stable/ocata

commit 9a9ae04a86bf418a6f1eb196a737f45160769445
Author: gord chung <email address hidden>
Date: Tue Feb 28 12:17:25 2017 -0500

    don't setup logging or cors when not needed

    publisher/dispatcher are used by ceilometer which already has logging
    set up. don't do it again.

    Change-Id: I13ec9797b2794f910b55adbc70d47892ce4cdddf
    Closes-Bug: #1666174
    (cherry picked from commit 3fbfd60e45c10c18d1a662e64495f564443e43b2)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/panko 2.0.1

This issue was fixed in the openstack/panko 2.0.1 release.

Gautam Prasad (gautpras)
no longer affects: ceilometer
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/panko 3.0.0

This issue was fixed in the openstack/panko 3.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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