diff --git a/muted-tests.yml b/muted-tests.yml index b026cc6a4128b..72ccad9014271 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -361,9 +361,6 @@ tests: - class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT method: test {yaml=reference/cat/health/cat-health-no-timestamp-example} issue: https://github.com/elastic/elasticsearch/issues/121867 -- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests - method: testCreateAndRestorePartialSearchableSnapshot - issue: https://github.com/elastic/elasticsearch/issues/121927 - class: org.elasticsearch.analysis.common.CommonAnalysisClientYamlTestSuiteIT method: test {yaml=analysis-common/40_token_filters/stemmer_override file access} issue: https://github.com/elastic/elasticsearch/issues/121625 diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java index 2d8d78473501c..a02c32cd56d94 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full/CacheService.java @@ -245,7 +245,11 @@ private void ensureLifecycleStarted() { final Lifecycle.State state = lifecycleState(); assert state != Lifecycle.State.INITIALIZED : state; if (state != Lifecycle.State.STARTED) { - throw new IllegalStateException("Failed to read data from cache: cache service is not started [" + state + "]"); + if (state == Lifecycle.State.STOPPED) { + throw new AlreadyClosedException("Failed to read data from cache: cache service is stopped"); + } else { + throw new IllegalStateException("Failed to read data from cache: cache service is not started [" + state + "]"); + } } }