From 00dd12d6d103dbe0a45fa82c2928cc159e09351e Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 12 Mar 2012 15:52:11 -0700 Subject: [PATCH] Fix default receive.timeout This should be in milliseconds, not seconds. Set the default to be 2 minutes in milliseconds and update the documentation to reflect that milliseconds are the default unit of time used here. Change-Id: I50d74e91f4acec2b91daf59a16966cb89045d064 --- Documentation/config-gerrit.txt | 11 +++++++---- .../google/gerrit/server/git/AsyncReceiveCommits.java | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 5284d8989c..ec55b570ef 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -1716,11 +1716,14 @@ Defaults to the number of available CPUs according to the Java runtime. [[receive.timeout]]receive.timeout:: + -Overall timeout on the time taken to process the change data in received packs. -Only includes the time processing Gerrit changes and updating references, not -the time to index the pack. +Overall timeout on the time taken to process the change data in +received packs. Only includes the time processing Gerrit changes +and updating references, not the time to index the pack. Values can +be specified using standard time unit abbreviations ('ms', 'sec', +'min', etc.). + -Default is 120 seconds. +Default is 2 minutes. If no unit is specified, millisconds +is assumed. [[repository]]Section repository diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/AsyncReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/AsyncReceiveCommits.java index b78f15aae4..c2fe1a2033 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/AsyncReceiveCommits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/AsyncReceiveCommits.java @@ -73,8 +73,8 @@ public class AsyncReceiveCommits implements PreReceiveHook { long getTimeoutMillis(@GerritServerConfig final Config cfg) { return ConfigUtil.getTimeUnit( cfg, "receive", null, "timeout", - TimeUnit.SECONDS.convert(2, TimeUnit.MINUTES), - TimeUnit.SECONDS); + TimeUnit.MINUTES.toMillis(2), + TimeUnit.MILLISECONDS); } }