You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/02/16 15:44:44 UTC

[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10401: Refactor http-based alarm plugins and extract common logic to `HttpAlarmCallback`

kezhenxu94 commented on code in PR #10401:
URL: https://github.com/apache/skywalking/pull/10401#discussion_r1108670112


##########
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmCore.java:
##########
@@ -82,7 +82,9 @@ public void start(List<AlarmCallback> allCallbacks) {
                     }
                     List<AlarmMessage> filteredMessages = alarmMessageList.stream().filter(msg -> !msg.isOnlyAsCondition()).collect(Collectors.toList());
                     if (!filteredMessages.isEmpty()) {
-                        allCallbacks.forEach(callback -> callback.doAlarm(filteredMessages));
+                        for (AlarmCallback callback : allCallbacks) {
+                            callback.doAlarm(filteredMessages);
+                        }

Review Comment:
   > Why change this?
   
   To propagate the exception up to the caller, we don't want to catch the exception in every plugin, because there is a place to catch all and print the logs in the alarm core
   
   https://github.com/apache/skywalking/blob/da9fc57804a130d884c8ce0997073f9b32809c71/oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmCore.java#L80-L93



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org