You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2024/06/06 21:40:58 UTC
(couchdb) 01/01: IndexManager keep at least one index open
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch nouveau-healthcheck-test-failure-fix
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f0b4989f9752dc9c1876efc22b1ffc2d1cf6c151
Author: Robert Newson <Ro...@ibm.com>
AuthorDate: Thu Jun 6 22:39:07 2024 +0100
IndexManager keep at least one index open
the IndexHealthCheckTest intermittently fails we think because
Caffeine is closing the index (flagged to be deleted on close) while
the health check is running, as the test IndexManager had a maxIndexesOpen
of 0, since that is what the int member variable is initialised to if
not set explicitly.
---
Makefile | 2 +-
.../src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 3386d9c26..7b31656cc 100644
--- a/Makefile
+++ b/Makefile
@@ -563,7 +563,7 @@ nouveau-test: nouveau-test-gradle nouveau-test-elixir
.PHONY: nouveau-test-gradle
nouveau-test-gradle: couch nouveau
ifeq ($(with_nouveau), true)
- @cd nouveau && ./gradlew test --info
+ @cd nouveau && ./gradlew test --info --rerun
endif
.PHONY: nouveau-test-elixir
diff --git a/nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java b/nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java
index f6bfaccc3..8f891b1d7 100644
--- a/nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java
+++ b/nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexManager.java
@@ -26,6 +26,7 @@ import com.github.benmanes.caffeine.cache.RemovalListener;
import com.github.benmanes.caffeine.cache.Scheduler;
import com.github.benmanes.caffeine.cache.Weigher;
import io.dropwizard.lifecycle.Managed;
+import jakarta.validation.constraints.Positive;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response.Status;
import java.io.File;
@@ -68,7 +69,8 @@ public final class IndexManager implements Managed {
private static final Logger LOGGER = LoggerFactory.getLogger(IndexManager.class);
- private int maxIndexesOpen;
+ @Positive
+ private int maxIndexesOpen = 1;
private int commitIntervalSeconds;