You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/04/11 01:37:05 UTC
[GitHub] [dolphinscheduler] zhuangchong commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information
zhuangchong commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r846888242
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -131,8 +156,11 @@ public void sendServerStopedAlert(int alertGroupId, String host, String serverTy
alert.setAlertGroupId(alertGroupId);
alert.setCreateTime(new Date());
alert.setUpdateTime(new Date());
+ alert.setSign(generateSign(alert));
// we use this method to avoid insert duplicate alert(issue #5525)
- alertMapper.insertAlertWhenServerCrash(alert);
+ // we modified this method to optimize performance(issue #9174)
+ Date crashAlarmSuppressionStartTime = DateTime.now().plusMinutes(-crashAlarmSuppression).toDate();
+ alertMapper.insertAlertWhenServerCrash(alert, crashAlarmSuppressionStartTime);
Review Comment:
This method is triggered when the master server or worker server stops, which is not a lot, I suggest that you don't need to add. Can be added to the alert server.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org