Skip to content

Commit 84a92dc

Browse files
authored
Initialize TermsEnum eagerly (#136279) (#136287)
Temporary workaround for #136268
1 parent 7979464 commit 84a92dc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/changelog/136279.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 136279
2+
summary: Initialize `TermsEnum` eagerly
3+
area: Search
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.apache.logging.log4j.Logger;
1414
import org.apache.logging.log4j.core.LoggerContext;
1515
import org.apache.logging.log4j.core.config.Configurator;
16+
import org.apache.lucene.index.TermsEnum;
1617
import org.apache.lucene.util.Constants;
1718
import org.apache.lucene.util.StringHelper;
1819
import org.apache.lucene.util.VectorUtil;
@@ -203,6 +204,8 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
203204
IfConfig.logIfNecessary();
204205

205206
ensureInitialized(
207+
// See https://github.com/elastic/elasticsearch/issues/136268
208+
TermsEnum.class,
206209
// ReleaseVersions does nontrivial static initialization which should always succeed but load it now (before SM) to be sure
207210
ReleaseVersions.class,
208211
// ReferenceDocs class does nontrivial static initialization which should always succeed but load it now (before SM) to be sure

0 commit comments

Comments
 (0)