Increase 'execution.defaultThreadPoolSize' default and min to 2 GC operation might be time consuming and it prevents the other tasks to be executed in WorkQueue (e.g. reviewers plugin cannot add reviewers). Set default and minimum value to 2 so that running GC (either scheduled or on-demand) is not blocking other background tasks. Change-Id: I234e8754f235c1e10837dc98b9c4e3b9568676aa Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index fb4335b..57694e9 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt
@@ -4152,7 +4152,8 @@ The default size of the background execution thread pool in which miscellaneous tasks are handled. + -Default is 1. +Default and minimum is 2 so that a single, potentially longer executing +task (e.g. GC), is not blocking the entire execution. [[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize:: +
diff --git a/java/com/google/gerrit/server/git/WorkQueue.java b/java/com/google/gerrit/server/git/WorkQueue.java index a7336f0..2d97d04f 100644 --- a/java/com/google/gerrit/server/git/WorkQueue.java +++ b/java/com/google/gerrit/server/git/WorkQueue.java
@@ -100,7 +100,7 @@ @Inject WorkQueue(IdGenerator idGenerator, @GerritServerConfig Config cfg, MetricMaker metrics) { - this(idGenerator, cfg.getInt("execution", "defaultThreadPoolSize", 1), metrics); + this(idGenerator, Math.max(cfg.getInt("execution", "defaultThreadPoolSize", 2), 2), metrics); } /** Constructor to allow binding the WorkQueue more explicitly in a vhost setup. */