Skip to content

Commit

Permalink
Fix weird panama integration failure (#96715)
Browse files Browse the repository at this point in the history
# The issue:

VectorUtil will Load the Panama Vector incubator module if users have it enabled. However, if the first time its loaded is in a restricted security context, it will fail. There are two issues:

 - Accessing the Log4j logger (see related: #93714)
 - The JDK leaking privileged access via [JDK-8309727
](https://bugs.openjdk.org/browse/JDK-8309727)

# The fix:

Eagerly load the module if supported through combining apache/lucene#12362 with `org.elasticsearch.bootstrap.Elasticsearch#ensureInitialized.`
  • Loading branch information
benwtrent authored Jun 12, 2023
1 parent e8f7e31 commit a9e807a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.StringHelper;
import org.apache.lucene.util.VectorUtil;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.action.support.SubscribableListener;
Expand Down Expand Up @@ -186,7 +187,9 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
ReferenceDocs.class,
// The following classes use MethodHandles.lookup during initialization, load them now (before SM) to be sure they succeed
AbstractRefCounted.class,
SubscribableListener.class
SubscribableListener.class,
// We eagerly initialize to work around log4j permissions & JDK-8309727
VectorUtil.class
);

// install SM after natives, shutdown hooks, etc.
Expand Down

0 comments on commit a9e807a

Please sign in to comment.