alarm has no constraint of maximum of IntegerType

Bug #1315819 reported by Liusheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aodh
Triaged
Medium
Unassigned

Bug Description

With mysql as storage backend, If I use following command to create a threshold alarm:

ceilometer alarm-threshold-create -m instance --name abd --evaluation-periods 1000000000000000000000000000000000000000000000000 --threshold 10

It will be created successfully, but this alarm cannot be evluated, the trace of alarm-evluator is:

[-] evaluating alarm d7796ce7-744e-439f-afca-60c2730b3a2e _evaluate_alarm /opt/stack/ceilometer/ceilometer/alarm/service.py:86
[-] alarm evaluation cycle failed
Traceback (most recent call last):
  File "/opt/stack/ceilometer/ceilometer/alarm/service.py", line 75, in _evaluate_assigned_alarms
    self._evaluate_alarm(alarm)
  File "/opt/stack/ceilometer/ceilometer/alarm/service.py", line 87, in _evaluate_alarm
    self.evaluators[alarm.type].obj.evaluate(alarm)
  File "/opt/stack/ceilometer/ceilometer/alarm/evaluator/threshold.py", line 203, in evaluate
    alarm.rule['query']
  File "/opt/stack/ceilometer/ceilometer/alarm/evaluator/threshold.py", line 63, in _bound_duration
    start = now - datetime.timedelta(seconds=window)
OverflowError: Python int too large to convert to C long

Liusheng (liusheng)
Changed in ceilometer:
assignee: nobody → Liusheng (liusheng)
Eoghan Glynn (eglynn)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Agreed, very large *positive* periods should be truncated to the number of seconds since the epoch if necessary (otherwise the value is meaningless).

But I don't think your example above is correct, specifically the large *negative* period. This fails verification as expected:

api.log: 2014-05-08 14:30:34.806 3071 WARNING wsme.api [-] Client-side error: Invalid input for field/attribute evaluation_periods. Value: '-1000000000000000000000000000000000000000000000000'. Value should be greater or equal to 1

response: {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Invalid input for field/attribute evaluation_periods. Value: '-1000000000000000000000000000000000000000000000000'. Value should be greater or equal to 1"}}

Revision history for this message
Liusheng (liusheng) wrote :

sorry , indeed, there is no minus before the big intiger

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

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

Changed in ceilometer:
status: Triaged → In Progress
Changed in ceilometer:
assignee: Liusheng (liusheng) → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ceilometer (master)

Change abandoned by liusheng (<email address hidden>) on branch: master
Review: https://review.openstack.org/141781
Reason: will be in aodh

gordon chung (chungg)
Changed in ceilometer:
status: In Progress → Triaged
assignee: ZhiQiang Fan (aji-zqfan) → nobody
Lianhao Lu (lianhao-lu)
affects: ceilometer → aodh
summary: - ceilometer has no constraint of maximum of IntegerType
+ alarm has no constraint of maximum of IntegerType
Liusheng (liusheng)
Changed in aodh:
assignee: nobody → Liusheng (liusheng)
gordon chung (chungg)
Changed in aodh:
assignee: Liusheng (liusheng) → nobody
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/286095

Changed in aodh:
assignee: nobody → Ilya Tyaptin (ityaptin)
status: Triaged → In Progress
gordon chung (chungg)
Changed in aodh:
assignee: Ilya Tyaptin (ityaptin) → nobody
status: In Progress → Triaged
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.