summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdithya Chakilam <achakila@codeaurora.org>2021-01-05 18:02:06 -0600
committerAdithya Chakilam <achakila@codeaurora.org>2021-01-28 17:23:37 +0000
commitd112393b960f544b8c3b05bebb9d952b77e4f66b (patch)
tree79105f2b82d19203886334c04be588ad706c5673
parentaa2792a5f8a89c21e776cea29082a95d459e0697 (diff)
Fix inconsistent logging for scheduled pushes
In cases where the replication start command is triggered with --now, logs incorrectly show that replication is scheduled with default delay. This change fixes it. In cases where a push is consolidated with an existing pending push, logs are added to specifically mention it. Change-Id: I296a2ec5772eb60b38dd47502fa3bd5d247d317a
-rw-r--r--src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
index 12f0273..1febf17 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java
@@ -429,13 +429,16 @@ public class Destination {
ScheduledFuture<?> ignored =
pool.schedule(task, now ? 0 : config.getDelay(), TimeUnit.SECONDS);
pending.put(uri, task);
+ repLog.atInfo().log(
+ "scheduled %s:%s => %s to run %s",
+ project, ref, task, now ? "now" : "after " + config.getDelay() + "s");
} else {
addRef(task, ref);
task.addState(ref, state);
+ repLog.atInfo().log(
+ "consolidated %s:%s => %s with an existing pending push", project, ref, task);
}
state.increasePushTaskCount(project.get(), ref);
- repLog.atInfo().log(
- "scheduled %s:%s => %s to run after %ds", project, ref, task, config.getDelay());
}
}