Skip to content

Ignore _JAVA_OPTIONS - #124843

Merged
rjernst merged 6 commits into
elastic:mainfrom
rjernst:startup/ignore_java_options
Mar 15, 2025
Merged

rjernst merged 6 commits into
elastic:mainfrom
rjernst:startup/ignore_java_options

Conversation

@rjernst

@rjernst rjernst commented Mar 14, 2025

Copy link
Copy Markdown
Member

The JVM has a couple ways that Java options can be passed. In Elasticsearch we ignore these common patterns, instead using our own bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary reason for this is some systems like Ubuntu setting these options globally and then affecting Elasticsearch, often in ways that cause Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment variable that the JVM may pick up options from.

The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
@rjernst
rjernst requested a review from a team as a code owner March 14, 2025 04:08
@rjernst
rjernst requested a review from DaveCTurner March 14, 2025 04:08
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Mar 14, 2025
@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @rjernst, I've created a changelog YAML for you.

@DaveCTurner DaveCTurner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need the same in distribution/src/bin/elasticsearch-env.bat too

@rjernst

rjernst commented Mar 14, 2025

Copy link
Copy Markdown
Member Author

Doh! I had done the change to the .bat but the wrong one (a build file) 🤦 . Pushed that as well.

@DaveCTurner DaveCTurner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjernst

rjernst commented Mar 14, 2025

Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@rjernst rjernst added the auto-backport Automatically create backport pull requests when merged label Mar 14, 2025
@rjernst
rjernst enabled auto-merge (squash) March 14, 2025 19:23
@rjernst

rjernst commented Mar 15, 2025

Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
✅ 8.18
✅ 8.x
✅ 9.0

rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 15, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 15, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Mar 15, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
elasticsearchmachine pushed a commit that referenced this pull request Mar 15, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
elasticsearchmachine pushed a commit that referenced this pull request Mar 15, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.
elasticsearchmachine pushed a commit that referenced this pull request Mar 17, 2025
The JVM has a couple ways that Java options can be passed. In
Elasticsearch we ignore these common patterns, instead using our own
bespoke mechanisms for setting options (ES_JAVA_OPTS, etc). The primary
reason for this is some systems like Ubuntu setting these options
globally and then affecting Elasticsearch, often in ways that cause
Elasticsearch to fail to start.

This commit ignores _JAVA_OPTIONS, which is a little known environment
variable that the JVM may pick up options from.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/CLI CLI utilities, scripts, and infrastructure >enhancement Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants