event-alarm: evaluation failure in generating log message

Bug #1492098 reported by Ryota Mibu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aodh
Fix Released
High
Ryota Mibu

Bug Description

The evaluator for even-alarm fails to evaluate alarms in debug mode.
The reason is that the evaluator is trying to count the number of found alarms where alarms is not list but generator.

2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher [-] Exception during message handling
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher Traceback (most recent call last):
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/dispatcher.py", line 92, in _dispatch_and_handle
_error
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher executor_callback)
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/dispatcher.py", line 135, in _dispatch
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher metadata)
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher File "/opt/stack/aodh/aodh/event.py", line 40, in sample
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher self.evaluator.evaluate_events(payload)
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher File "/opt/stack/aodh/aodh/evaluator/event.py", line 71, in evaluate_events
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher {'num': len(alarms), 'id': event['message_id']})
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher TypeError: object of type 'generator' has no len()
2015-09-03 14:26:06.128 7819 ERROR oslo_messaging.notify.dispatcher

Tags: event-alarm
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to aodh (master)

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

Changed in aodh:
assignee: nobody → Ryota Mibu (r-mibu)
status: New → In Progress
Changed in aodh:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to aodh (master)

Reviewed: https://review.openstack.org/220420
Committed: https://git.openstack.org/cgit/openstack/aodh/commit/?id=744057f16dac419ba463e00ac12fed022d70d84f
Submitter: Jenkins
Branch: master

commit 744057f16dac419ba463e00ac12fed022d70d84f
Author: Ryota MIBU <email address hidden>
Date: Fri Sep 4 12:00:57 2015 +0900

    event-alarm: delete debug message to show # of alarms

    This patch delete the debug log mssage to show the number of alarms
    found at the beginning of event evaluation. Developer still can see
    those alarms in the log messages generated in each alarm evaluation.

    The alarm storage api returns generator, so it should be safe that
    we don't touch the returned value.

    Change-Id: I6d61be5ab8ae2ee53a1528477a5686a5e7fa33d6
    Closes-Bug: #1492098

Changed in aodh:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote :

That was actually merged after the 1.0.0 tag

Changed in aodh:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
milestone: 1.0.0 → none
Thierry Carrez (ttx)
Changed in aodh:
milestone: none → 1.1.0
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

Remote bug watches

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