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/06 10:13:11 UTC

[GitHub] [dolphinscheduler] czeming opened a new pull request, #9371: Issue 9174

czeming opened a new pull request, #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371

   <!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
   
   
   ## Purpose of the pull request
   
   This pr will close https://github.com/apache/dolphinscheduler/issues/9174.
   1. Add range for alarm suppression.
   2. Optimize query logic.
   
   see https://github.com/apache/dolphinscheduler/commit/f8ecb536b71d6f33b71c73930832b62890b84ea1
   
   ## Supplement
   
   I read commit `https://github.com/apache/dolphinscheduler/commit/f8ecb536b71d6f33b71c73930832b62890b84ea1` and class `org.apache.dolphinscheduler.dao.AlertDao`.
   
   It modified method `org.apache.dolphinscheduler.dao.AlertDao#sendServerStopedAlert`, but other logics have not changed. I speculate that the scene this friend is facing is just to reduce the frequency of redundant machine alarms in a time period. Judging by whether the content is equal is the actual demand. I think adding message ID to judge by message ID will lead to the invalidation of the logic he added and make this judgment meaningless, because it is difficult for multiple redundant machine actions of the same host to occur at the same time point (the ID will obviously be different).
   
   In addition, if my understanding is correct, there is a hidden danger in the submission itself. The following logic will cause the same host crash not to be notified in the future.
   
   ```
   where content = #{alert.content} and alert_status = #{alert.alertStatus.code}
   ```
   and
   ```
   ServerAlertContent serverStopAlertContent = ServerAlertContent.newBuilder()
           .type(serverType)
           .host(host)
           .event(AlertEvent.SERVER_DOWN)
           .warningLevel(AlertWarnLevel.SERIOUS).
           build();
   String content = JSONUtils.toJsonString(Lists.newArrayList(serverStopAlertContent));
   ```
   
   To sum up, the needs of both parties are:
   1. The redundant machine will not be notified repeatedly for a period of time
   2. Improve processing efficiency
   
   A low-cost change can be to change the judgment condition of SQL to
   ```
   where content = #{alert.content} and alert_status = #{alert.alertStatus.code} and create_time >= ${No alarm start time}
   ```
   
   However, if table `t_ds_alert` is used for more alarms in the future, its data volume may be more than now. Even if field `create_time` is used as a condition, there is still room for optimization when using field `content` to make an equal judgment.
   
   We can consider adding a field to calculate the content and other information combinations representing the message content to calculate the signature information, and use this field as the judgment basis.
   
   


-- 
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


[GitHub] [dolphinscheduler] czeming commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r843952487


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -81,13 +77,27 @@ public int addAlert(Alert alert) {
      * @return update alert result
      */
     public int updateAlert(AlertStatus alertStatus, String log, int id) {
-        Alert alert = alertMapper.selectById(id);
+        Alert alert = new Alert();
+        alert.setId(id);
         alert.setAlertStatus(alertStatus);
         alert.setUpdateTime(new Date());
         alert.setLog(log);
         return alertMapper.updateById(alert);
     }
 
+    /**
+     * 生成通知签名信息
+     * @param alert 通知实体
+     * @return 签名文本

Review Comment:
   Done



-- 
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


[GitHub] [dolphinscheduler] czeming commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1091010390

   @lenboo please review again, thanks.


-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1092401487

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [6 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [37 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![32.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '32.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [32.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1094505328

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [6 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [38 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![33.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '33.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [33.2% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1096114829

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [6 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [61 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![36.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '36.1%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [36.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] czeming commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1095015983

   @zhuangchong  please review again, thx!


-- 
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


[GitHub] [dolphinscheduler] czeming commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1096189148

   @zhuangchong  I resolve the code conflicts. please review again, thx!


-- 
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


[GitHub] [dolphinscheduler] zhuangchong commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1094448549

   Please resolve code conflicts first.


-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1094812699

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [6 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [38 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![33.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '33.1%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [33.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1096215157

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![61.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '61.9%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [61.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] SbloodyS merged pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
SbloodyS merged PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371


-- 
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


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1090994038

   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#9371](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fcc6290) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/4a29c6a6c8dffd3522c89a8ddd0139ef8bde5922?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a29c6a) will **increase** coverage by `0.02%`.
   > The diff coverage is `47.20%`.
   
   > :exclamation: Current head fcc6290 differs from pull request most recent head b861425. Consider uploading reports for the commit b861425 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev    #9371      +/-   ##
   ============================================
   + Coverage     39.98%   40.01%   +0.02%     
   - Complexity     4375     4387      +12     
   ============================================
     Files           822      823       +1     
     Lines         32924    32962      +38     
     Branches       3656     3658       +2     
   ============================================
   + Hits          13165    13189      +24     
   - Misses        18532    18542      +10     
   - Partials       1227     1231       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...lugin/alert/wechat/WeChatAlertParamsConstants.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXBsdWdpbnMvZG9scGhpbnNjaGVkdWxlci1hbGVydC13ZWNoYXQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL2FsZXJ0L3dlY2hhdC9XZUNoYXRBbGVydFBhcmFtc0NvbnN0YW50cy5qYXZh) | `0.00% <ø> (ø)` | |
   | [...uler/plugin/alert/wechat/WechatAppChatMessage.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXBsdWdpbnMvZG9scGhpbnNjaGVkdWxlci1hbGVydC13ZWNoYXQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL2FsZXJ0L3dlY2hhdC9XZWNoYXRBcHBDaGF0TWVzc2FnZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...cheduler/plugin/alert/wechat/WechatAppMessage.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXBsdWdpbnMvZG9scGhpbnNjaGVkdWxlci1hbGVydC13ZWNoYXQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL2FsZXJ0L3dlY2hhdC9XZWNoYXRBcHBNZXNzYWdlLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...inscheduler/api/controller/ExecutorController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvRXhlY3V0b3JDb250cm9sbGVyLmphdmE=) | `40.00% <ø> (ø)` | |
   | [...er/api/service/impl/TaskDefinitionServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9UYXNrRGVmaW5pdGlvblNlcnZpY2VJbXBsLmphdmE=) | `24.01% <ø> (+0.05%)` | :arrow_up: |
   | [...che/dolphinscheduler/common/enums/AlertStatus.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL2VudW1zL0FsZXJ0U3RhdHVzLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...uler/server/master/registry/ServerNodeManager.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9yZWdpc3RyeS9TZXJ2ZXJOb2RlTWFuYWdlci5qYXZh) | `1.28% <0.00%> (ø)` | |
   | [.../org/apache/dolphinscheduler/dao/entity/Alert.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL2VudGl0eS9BbGVydC5qYXZh) | `65.38% <21.42%> (+19.11%)` | :arrow_up: |
   | [...hinscheduler/plugin/alert/wechat/WeChatSender.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXBsdWdpbnMvZG9scGhpbnNjaGVkdWxlci1hbGVydC13ZWNoYXQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL2FsZXJ0L3dlY2hhdC9XZUNoYXRTZW5kZXIuamF2YQ==) | `29.78% <36.36%> (-7.79%)` | :arrow_down: |
   | [...org/apache/dolphinscheduler/alert/AlertSender.java](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9kb2xwaGluc2NoZWR1bGVyLWFsZXJ0LXNlcnZlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC9BbGVydFNlbmRlci5qYXZh) | `71.92% <53.33%> (-2.11%)` | :arrow_down: |
   | ... and [5 more](https://codecov.io/gh/apache/dolphinscheduler/pull/9371/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c294979...b861425](https://codecov.io/gh/apache/dolphinscheduler/pull/9371?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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


[GitHub] [dolphinscheduler] zhuangchong commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r846889745


##########
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


[GitHub] [dolphinscheduler] czeming commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r847980497


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -52,13 +54,8 @@
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import javax.annotation.PreDestroy;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS;
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS;

Review Comment:
   Is my mistake. I didn't import the style check configuration `style/checkstyle.xml`.
   
   I have solved all the files related to my changes. In addition, I see many codes with the same problems.
   
   
   I think we can improve the documentation provided to developers, which is expected to improve the quality of subsequent code.
   
   From this configuration `style/checkstyle.xml` > `ImportOrder`:
   
   ```
           <module name="ImportOrder">
               <property name="staticGroups" value="org.apache.dolphinscheduler,org.apache,java,javax,org,com"/>
               <property name="separatedStaticGroups" value="true"/>
   
               <property name="groups" value="org.apache.dolphinscheduler,org.apache,java,javax,org,com"/>
               <property name="ordered" value="true"/>
               <property name="separated" value="true"/>
               <property name="option" value="top"/>
               <property name="sortStaticImportsAlphabetically" value="true"/>
           </module>
   ```



-- 
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


[GitHub] [dolphinscheduler] lenboo commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
lenboo commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r843892249


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -81,13 +77,27 @@ public int addAlert(Alert alert) {
      * @return update alert result
      */
     public int updateAlert(AlertStatus alertStatus, String log, int id) {
-        Alert alert = alertMapper.selectById(id);
+        Alert alert = new Alert();
+        alert.setId(id);
         alert.setAlertStatus(alertStatus);
         alert.setUpdateTime(new Date());
         alert.setLog(log);
         return alertMapper.updateById(alert);
     }
 
+    /**
+     * 生成通知签名信息
+     * @param alert 通知实体
+     * @return 签名文本

Review Comment:
   @czeming English comments is recommended.



-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1090997144

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![51.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/50-16px.png '51.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [51.2% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![1.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '1.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [1.8% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r845676769


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -17,39 +17,35 @@
 
 package org.apache.dolphinscheduler.dao;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dolphinscheduler.common.enums.AlertEvent;
 import org.apache.dolphinscheduler.common.enums.AlertStatus;
 import org.apache.dolphinscheduler.common.enums.AlertWarnLevel;
 import org.apache.dolphinscheduler.common.enums.WarningType;
 import org.apache.dolphinscheduler.common.utils.JSONUtils;
-import org.apache.dolphinscheduler.dao.entity.Alert;
-import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
-import org.apache.dolphinscheduler.dao.entity.AlertSendStatus;
-import org.apache.dolphinscheduler.dao.entity.ProcessAlertContent;
-import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
-import org.apache.dolphinscheduler.dao.entity.ProjectUser;
-import org.apache.dolphinscheduler.dao.entity.ServerAlertContent;
-import org.apache.dolphinscheduler.dao.entity.TaskInstance;
+import org.apache.dolphinscheduler.dao.entity.*;

Review Comment:
   Please avoid import ```*```



-- 
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


[GitHub] [dolphinscheduler] czeming commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r846902047


##########
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:
   I resolved the conflict.
   
   Add reason for _crashAlarmSuppressionStartTime_: 
   1. The addition of this parameter is a key condition for the initial screening of data, which can reduce the performance problems caused by the increase of data.
   2. **If this parameter is not added, according to the current logic, the warning after the first time of the same host will not be added.** 



-- 
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


[GitHub] [dolphinscheduler] zhuangchong commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r847857541


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java:
##########
@@ -52,13 +54,8 @@
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
-import javax.annotation.PreDestroy;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS;
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS;

Review Comment:
   This part of checkstyle is wrong. It is not clear that CI has not detected it, but it can be detected locally. It is recommended to modify it.



-- 
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


[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r845676988


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -17,39 +17,35 @@
 
 package org.apache.dolphinscheduler.dao;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dolphinscheduler.common.enums.AlertEvent;
 import org.apache.dolphinscheduler.common.enums.AlertStatus;
 import org.apache.dolphinscheduler.common.enums.AlertWarnLevel;
 import org.apache.dolphinscheduler.common.enums.WarningType;
 import org.apache.dolphinscheduler.common.utils.JSONUtils;
-import org.apache.dolphinscheduler.dao.entity.Alert;
-import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
-import org.apache.dolphinscheduler.dao.entity.AlertSendStatus;
-import org.apache.dolphinscheduler.dao.entity.ProcessAlertContent;
-import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
-import org.apache.dolphinscheduler.dao.entity.ProjectUser;
-import org.apache.dolphinscheduler.dao.entity.ServerAlertContent;
-import org.apache.dolphinscheduler.dao.entity.TaskInstance;
+import org.apache.dolphinscheduler.dao.entity.*;
 import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertPluginInstanceMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertSendStatusMapper;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-import com.google.common.collect.Lists;
+import java.util.*;

Review Comment:
   Same here.



-- 
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


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1094490037

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=9371)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG) [6 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL) [37 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=9371&resolved=false&types=CODE_SMELL)
   
   [![33.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/25-16px.png '33.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list) [33.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_coverage&view=list)  
   [![0.2%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.2%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list) [0.2% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=9371&metric=new_duplicated_lines_density&view=list)
   
   


-- 
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


[GitHub] [dolphinscheduler] zhuangchong commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r846911257


##########
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:
   You are right, it's me who didn't understand the requirement. Using `content` to determine is the problem.



-- 
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


[GitHub] [dolphinscheduler] czeming commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r845691703


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -17,39 +17,35 @@
 
 package org.apache.dolphinscheduler.dao;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dolphinscheduler.common.enums.AlertEvent;
 import org.apache.dolphinscheduler.common.enums.AlertStatus;
 import org.apache.dolphinscheduler.common.enums.AlertWarnLevel;
 import org.apache.dolphinscheduler.common.enums.WarningType;
 import org.apache.dolphinscheduler.common.utils.JSONUtils;
-import org.apache.dolphinscheduler.dao.entity.Alert;
-import org.apache.dolphinscheduler.dao.entity.AlertPluginInstance;
-import org.apache.dolphinscheduler.dao.entity.AlertSendStatus;
-import org.apache.dolphinscheduler.dao.entity.ProcessAlertContent;
-import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
-import org.apache.dolphinscheduler.dao.entity.ProjectUser;
-import org.apache.dolphinscheduler.dao.entity.ServerAlertContent;
-import org.apache.dolphinscheduler.dao.entity.TaskInstance;
+import org.apache.dolphinscheduler.dao.entity.*;
 import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertPluginInstanceMapper;
 import org.apache.dolphinscheduler.dao.mapper.AlertSendStatusMapper;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
-import com.google.common.collect.Lists;
+import java.util.*;

Review Comment:
   done, please review again, thanks.



-- 
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


[GitHub] [dolphinscheduler] czeming commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
czeming commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1092407178

   @zhuangchong please help me with this review? Thx!


-- 
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


[GitHub] [dolphinscheduler] zhuangchong commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [dolphinscheduler] lenboo commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
lenboo commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r843892249


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -81,13 +77,27 @@ public int addAlert(Alert alert) {
      * @return update alert result
      */
     public int updateAlert(AlertStatus alertStatus, String log, int id) {
-        Alert alert = alertMapper.selectById(id);
+        Alert alert = new Alert();
+        alert.setId(id);
         alert.setAlertStatus(alertStatus);
         alert.setUpdateTime(new Date());
         alert.setLog(log);
         return alertMapper.updateById(alert);
     }
 
+    /**
+     * 生成通知签名信息
+     * @param alert 通知实体
+     * @return 签名文本

Review Comment:
   @czeming English comments is promoted.



-- 
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


[GitHub] [dolphinscheduler] lenboo commented on a diff in pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
lenboo commented on code in PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#discussion_r843892249


##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/AlertDao.java:
##########
@@ -81,13 +77,27 @@ public int addAlert(Alert alert) {
      * @return update alert result
      */
     public int updateAlert(AlertStatus alertStatus, String log, int id) {
-        Alert alert = alertMapper.selectById(id);
+        Alert alert = new Alert();
+        alert.setId(id);
         alert.setAlertStatus(alertStatus);
         alert.setUpdateTime(new Date());
         alert.setLog(log);
         return alertMapper.updateById(alert);
     }
 
+    /**
+     * 生成通知签名信息
+     * @param alert 通知实体
+     * @return 签名文本

Review Comment:
   @czeming English comments is recommanded.



-- 
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


[GitHub] [dolphinscheduler] lenboo commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
lenboo commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1090223463

   @czeming Thank you for your contribution. Please note that there are some ut failures.


-- 
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


[GitHub] [dolphinscheduler] SbloodyS commented on pull request #9371: [Fix-9174] [Alert] Fix deduplication of alarm information

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on PR #9371:
URL: https://github.com/apache/dolphinscheduler/pull/9371#issuecomment-1098648444

   @czeming Thanks for your contribution. This is a good beginning. Considering that it's your first contribution, I think we can get deep communication, you can contact me through mail or add WeChat(SbloodyS), when mail or added, please tell me who you are. I think I can help to familiar with the Dolphinscheduler if you meet with problems.


-- 
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