From e51b239f0f954d95e8dc278aa11290f8e3ef85be Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Fri, 31 Mar 2017 22:02:37 +0200 Subject: [PATCH] H2AccountPatchReviewStore: Set idle connection eviction time If timeBetweenEvictionRunsMillis is not set, it defaults to -1, which means the thread doing eviction of idle connections will not run. Change-Id: I927c5a61ad9944bbe4b52f8ee39e9a6782c39f5b --- .../google/gerrit/server/schema/H2AccountPatchReviewStore.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java b/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java index f78ff41033..d73c4310ad 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/schema/H2AccountPatchReviewStore.java @@ -103,6 +103,9 @@ public class H2AccountPatchReviewStore datasource.setMaxActive(50); datasource.setMinIdle(4); datasource.setMaxIdle(16); + long evictIdleTimeMs = 1000 * 60; + datasource.setMinEvictableIdleTimeMillis(evictIdleTimeMs); + datasource.setTimeBetweenEvictionRunsMillis(evictIdleTimeMs / 2); return datasource; }