Skip to content

Commit

Permalink
[kbn/es] Workaround arm64 container startup error (elastic#212458)
Browse files Browse the repository at this point in the history
Adds a temporary workaround for an issue with ES containers starting on
M4 based macs.
```
 info waiting for ES cluster to report a green status
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000ffff93d400a8, pid=7, tid=16
#
# JRE version:  (23.0+37) (build )
# Java VM: OpenJDK 64-Bit Server VM (23+37-2369, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-aarch64)
# Problematic frame:
# j  java.lang.System.registerNatives()V+0 java.base@23
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
```
  • Loading branch information
jbudz authored Feb 26, 2025
1 parent efcc63c commit d8d976e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/platform/packages/shared/kbn-es/src/utils/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,21 @@ const DOCKER_BASE_CMD = [
];

const DEFAULT_DOCKER_ESARGS: Array<[string, string]> = [
['ES_JAVA_OPTS', '-Xms1536m -Xmx1536m'],

['ES_LOG_STYLE', 'file'],

['discovery.type', 'single-node'],

['xpack.security.enabled', 'false'],
];
// Temporary workaround for https://github.com/elastic/elasticsearch/issues/118583
if (process.arch === 'arm64') {
DEFAULT_DOCKER_ESARGS.push(
['ES_JAVA_OPTS', '-Xms1536m -Xmx1536m -XX:UseSVE=0'],
['CLI_JAVA_OPTS', '-XX:UseSVE=0']
);
} else {
DEFAULT_DOCKER_ESARGS.push(['ES_JAVA_OPTS', '-Xms1536m -Xmx1536m']);
}

export const DOCKER_REPO = `${DOCKER_REGISTRY}/elasticsearch/elasticsearch`;
export const DOCKER_TAG = `${pkg.version}-SNAPSHOT`;
Expand Down Expand Up @@ -173,8 +180,6 @@ const SHARED_SERVERLESS_PARAMS = [

// only allow certain ES args to be overwrote by options
const DEFAULT_SERVERLESS_ESARGS: Array<[string, string]> = [
['ES_JAVA_OPTS', '-Xms1g -Xmx1g'],

['ES_LOG_STYLE', 'file'],

['cluster.name', 'stateless'],
Expand Down Expand Up @@ -212,6 +217,15 @@ const DEFAULT_SERVERLESS_ESARGS: Array<[string, string]> = [

['xpack.security.transport.ssl.verification_mode', 'certificate'],
];
// Temporary workaround for https://github.com/elastic/elasticsearch/issues/118583
if (process.arch === 'arm64') {
DEFAULT_SERVERLESS_ESARGS.push(
['ES_JAVA_OPTS', '-Xms1g -Xmx1g -XX:UseSVE=0'],
['CLI_JAVA_OPTS', '-XX:UseSVE=0']
);
} else {
DEFAULT_SERVERLESS_ESARGS.push(['ES_JAVA_OPTS', '-Xms1g -Xmx1g']);
}

const DEFAULT_SSL_ESARGS: Array<[string, string]> = [
['xpack.security.http.ssl.enabled', 'true'],
Expand Down

0 comments on commit d8d976e

Please sign in to comment.