[ 
https://issues.apache.org/jira/browse/IGNITE-10275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16688027#comment-16688027
 ] 

ASF GitHub Bot commented on IGNITE-10275:
-----------------------------------------

asfgit closed pull request #72: IGNITE-10275 Jira spam fast fix
URL: https://github.com/apache/ignite-teamcity-bot/pull/72
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
index 5ad13505..86768688 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
@@ -141,7 +141,7 @@ protected String runObserverTask() {
 
             if (info.isFinishedWithFailures(teamcity)) {
                 boolean rmv = compactInfos().remove(compactInfo);
-                
+
                 Preconditions.checkState(rmv, "Key not found: " + compactInfo);
 
                 logger.error("JIRA will not be commented." +
@@ -157,34 +157,35 @@ protected String runObserverTask() {
                 continue;
             }
 
-            ICredentialsProv creds = tcHelper.getServerAuthorizerCreds();
+            try {
+                rmvdVisas.add(objMapper.writeValueAsString(compactInfo));
+            }
+            catch (Exception e) {
+                logger.error("JSON string parse failed: " + e.getMessage(), e);
 
-            Visa visa = jiraIntegration.notifyJira(info.srvId, creds, 
info.buildTypeId,
-                info.branchForTc, info.ticket);
+                return "Exception while JSON parsing: " + 
e.getClass().getSimpleName() + ": " + e.getMessage();
+            }
 
-            
visasHistoryStorage.updateVisaRequestRes(info.getContributionKey(), info.date, 
visa);
+            try {
+                boolean rmv = compactInfos().remove(compactInfo);
 
-            if (visa.isSuccess()) {
-                ticketsNotified.add(info.ticket);
+                if (!rmv)
+                    continue;
+            }
+            catch (Exception e) {
+                logger.error("cache remove: " + e.getMessage(), e);
+
+                return X.getFullStackTrace(e);
+            }
 
-                try {
-                    rmvdVisas.add(objMapper.writeValueAsString(compactInfo));
-                }
-                catch (Exception e) {
-                    logger.error("JSON string parse failed: " + 
e.getMessage(), e);
+            ICredentialsProv creds = tcHelper.getServerAuthorizerCreds();
 
-                    return "Exception while JSON parsing: " + 
e.getClass().getSimpleName() + ": " + e.getMessage();
-                }
+            Visa visa = jiraIntegration.notifyJira(info.srvId, creds, 
info.buildTypeId,
+                info.branchForTc, info.ticket);
 
-                try {
-                    compactInfos().remove(compactInfo);
-                }
-                catch (Exception e) {
-                    logger.error("cache remove: " + e.getMessage(), e);
+            
visasHistoryStorage.updateVisaRequestRes(info.getContributionKey(), info.date, 
visa);
 
-                    return X.getFullStackTrace(e);
-                }
-            }
+            ticketsNotified.add(info.ticket);
         }
 
         return "Checked " + checkedBuilds + " not finished " + 
notFinishedBuilds + " notified: " + ticketsNotified +


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [TC Bot] Several JIRA comments are issued in case ignite.cache.remove failed
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-10275
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10275
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Dmitriy Pavlov
>            Assignee: PetrovMikhail
>            Priority: Major
>
> Examples of spam:
> - https://issues.apache.org/jira/browse/IGNITE-9308
> - https://issues.apache.org/jira/browse/IGNITE-10141
> org/apache/ignite/ci/observer/ObserverTask.java:179
> org.apache.ignite.IgniteCache#remove(K)
> returns false, so bot tries to re-comment ticket in next cycle.
> It is possible as a fast fix at first check removes result, as a full fix we 
> can refactor visa requests queue to some new (probably synthetic key).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to