)]}'
{"thresh/src/main/java/monasca/thresh/infrastructure/thresholding/AlarmThresholdingBolt.java":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"d030184cecbff88fd8118285c2dce73eb167bd96","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    // Wait for all sub alarms to have a state before evaluating to prevent flapping on startup"},{"line_number":217,"context_line":"    if (allSubAlarmsHaveState(alarm)) {"},{"line_number":218,"context_line":"      final AlarmDefinition alarmDefinition \u003d alarmDefinitions.get(alarm.getAlarmDefinitionId());"},{"line_number":219,"context_line":"      if (alarmDefinition \u003d\u003d null) {"},{"line_number":220,"context_line":"        logger.debug(\"Alarm-Definition for sub-alarm {} already removed\", subAlarm);"},{"line_number":221,"context_line":"        return;"},{"line_number":222,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":5,"id":"1a430d35_f995c332","line":219,"range":{"start_line":219,"start_character":6,"end_line":219,"end_character":36},"updated":"2017-02-07 20:15:05.000000000","message":"Can you add a comment that this should not normally happen, but there are corner cases where an alarm is created the same time an Alarm Definition is deleted?","commit_id":"547e75b2ab73bdd025d4bc8d39398a2571f1d42b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"fcf77c5baf542081ce0f0075c5b5f7ec80277cbe","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    // Wait for all sub alarms to have a state before evaluating to prevent flapping on startup"},{"line_number":217,"context_line":"    if (allSubAlarmsHaveState(alarm)) {"},{"line_number":218,"context_line":"      final AlarmDefinition alarmDefinition \u003d alarmDefinitions.get(alarm.getAlarmDefinitionId());"},{"line_number":219,"context_line":"      if (alarmDefinition \u003d\u003d null) {"},{"line_number":220,"context_line":"        logger.debug(\"Alarm-Definition for sub-alarm {} already removed\", subAlarm);"},{"line_number":221,"context_line":"        return;"},{"line_number":222,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":5,"id":"1a430d35_cb49e332","line":219,"range":{"start_line":219,"start_character":6,"end_line":219,"end_character":36},"in_reply_to":"1a430d35_d371b145","updated":"2017-02-08 16:29:38.000000000","message":"The Alarm would have to change state between the time the Alarm Definition Deleted event was received and before the Alarm Deleted Event was received. That should be a very small window, so I think it is a corner case.\n\nIf you wish to change the Threshold Engine to clean up the Alarms, that would be great. Please create a blueprint to document your design for that change and I can comment on it\n\nMetricFilteringBolt.deleteAlarmDefinition() can\u0027t call removeAlarm() because it doesn\u0027t know the actual metric that was used for each Alarm. It could do an exhaustive search of the entire alreadyFound ExistingHolder object and delete ones that matched the AlarmDefinitionId, but since that alreadyFound can be quite large, I wanted to avoid the exhaustive search","commit_id":"547e75b2ab73bdd025d4bc8d39398a2571f1d42b"},{"author":{"_account_id":17244,"name":"Joachim Barheine","email":"joachim.barheine@sap.com","username":"jobrs"},"change_message_id":"7b2b7584446e9c819eabea7bfebf1c59a1cad713","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    // Wait for all sub alarms to have a state before evaluating to prevent flapping on startup"},{"line_number":217,"context_line":"    if (allSubAlarmsHaveState(alarm)) {"},{"line_number":218,"context_line":"      final AlarmDefinition alarmDefinition \u003d alarmDefinitions.get(alarm.getAlarmDefinitionId());"},{"line_number":219,"context_line":"      if (alarmDefinition \u003d\u003d null) {"},{"line_number":220,"context_line":"        logger.debug(\"Alarm-Definition for sub-alarm {} already removed\", subAlarm);"},{"line_number":221,"context_line":"        return;"},{"line_number":222,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":5,"id":"1a430d35_d371b145","line":219,"range":{"start_line":219,"start_character":6,"end_line":219,"end_character":36},"in_reply_to":"1a430d35_f995c332","updated":"2017-02-08 15:33:41.000000000","message":"Good point! Is that really a corner case? As the alarm-deleted messages are sent after the alarm-definition-deleted event, I wonder whether this could happen quite frequently when Monasca is used under production load.\n\nAnyway I believe that the thresholder should really clean-up the alarms, because it cannot be ensured that the API will have a complete list of alarms before the thresholder has processed the alarm-definition-deletion message.\n\nSo what exactly is the reason why MetricFilteringBolt.deleteAlarmDefinition is not calling removeAlarm() for all metric-definitions (line 207-209)?","commit_id":"547e75b2ab73bdd025d4bc8d39398a2571f1d42b"}]}
