You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2018/10/29 10:53:05 UTC

[ignite-teamcity-bot] branch ignite-10030 updated: IGNITE-10030: Limiting build refs check during incremental upload

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-10030
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/ignite-10030 by this push:
     new 6bd749e  IGNITE-10030: Limiting build refs check during incremental upload
6bd749e is described below

commit 6bd749e3ebae828c56ac26b2e3a6dc09e6644be5
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Mon Oct 29 13:53:02 2018 +0300

    IGNITE-10030: Limiting build refs check during incremental upload
---
 .../ci/teamcity/ignited/TeamcityIgnitedImpl.java   | 22 +++++++++++++++++-----
 .../ignited/fatbuild/ProactiveFatBuildSync.java    |  2 +-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
index 96a2591..21fa53e 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
@@ -52,6 +52,12 @@ public class TeamcityIgnitedImpl implements ITeamcityIgnited {
     /** Max build id diff to enforce reload during incremental refresh. */
     public static final int MAX_ID_DIFF_TO_ENFORCE_CONTINUE_SCAN = 3000;
 
+    /**
+     * Max builds to check during incremental sync. If this value is reached (50 pages) and some stuck builds still not
+     * found, then iteration stops
+     */
+    public static final int MAX_INCREMENTAL_BUILDS_TO_CHECK = 5000;
+
     /** Server id. */
     private String srvNme;
 
@@ -211,7 +217,7 @@ public class TeamcityIgnitedImpl implements ITeamcityIgnited {
 
         if(!paginateUntil.isEmpty()) {
             //some builds may stuck in the queued or running, enforce loading as well
-            buildSync.scheduleBuildsLoad(conn, paginateUntil);
+            buildSync.doLoadBuilds(-1, srvNme, conn, paginateUntil);
         }
 
         // schedule full resync later
@@ -272,16 +278,22 @@ public class TeamcityIgnitedImpl implements ITeamcityIgnited {
             totalChecked += tcDataNextPage.size();
 
             if (!fullReindex) {
-                if (mandatoryToReload!=null && !mandatoryToReload.isEmpty())
+                if (mandatoryToReload != null && !mandatoryToReload.isEmpty())
                     tcDataNextPage.stream().map(BuildRef::getId).forEach(mandatoryToReload::remove);
 
-                if (savedCurChunk == 0 && (mandatoryToReload==null || mandatoryToReload.isEmpty()))
-                    break; // There are no modification at current page, hopefully no modifications at all
+                if (savedCurChunk == 0 &&
+                    (mandatoryToReload == null
+                        || mandatoryToReload.isEmpty()
+                        || totalChecked > MAX_INCREMENTAL_BUILDS_TO_CHECK)
+                ) {
+                    // There are no modification at current page, hopefully no modifications at all
+                    break;
+                }
             }
         }
 
         int leftToFind = mandatoryToReload == null ? 0 : mandatoryToReload.size();
-        return "Entries saved " + totalUpdated + " Builds checked " + totalChecked + " Needed to find " + neededToFind   + " remained to find " + leftToFind;
+        return "Entries saved " + totalUpdated + " Builds checked " + totalChecked + " Needed to find " + neededToFind + " remained to find " + leftToFind;
     }
 
     @NotNull private List<Integer> cacheKeysToBuildIds(Collection<Long> cacheKeysUpdated) {
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProactiveFatBuildSync.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProactiveFatBuildSync.java
index f6985e2..b5c2c56 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProactiveFatBuildSync.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProactiveFatBuildSync.java
@@ -160,7 +160,7 @@ public class ProactiveFatBuildSync {
     @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"})
     @MonitoredTask(name = "Proactive Builds Loading (srv,agent)", nameExtArgsIndexes = {1, 0})
     @AutoProfiling
-    protected String doLoadBuilds(int ldrNo, String srvId, ITeamcityConn conn, Set<Integer> load) {
+    public String doLoadBuilds(int ldrNo, String srvId, ITeamcityConn conn, Set<Integer> load) {
         if(load.isEmpty())
             return "Nothing to load";