Skip to content

Conversation

@rjernst
Copy link
Member

@rjernst rjernst commented Dec 14, 2022

Some libaries have static initializers that require security manager permissions. When this initialization occurs during normal operation, it can cause security manager exceptions depending on where a logging call is made.

This commit adds a place for static initialization of log4j utility classes to be run, and specifically adds the Unbox class which wants to read env vars.

closes #91964

Some libaries have static initializers that require security manager
permissions. When this initialization occurs during normal operation, it
can cause security manager exceptions depending on where a logging call
is made.

This commit adds a place for static initialization of log4j utility
classes to be run, and specifically adds the Unbox class which wants to
read env vars.

closes elastic#91964
@rjernst rjernst added :Core/Infra/Core Core issues without another label v8.6.1 v8.7.0 labels Dec 14, 2022
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Dec 14, 2022
@rjernst rjernst requested a review from grcevski December 14, 2022 19:44
@rjernst
Copy link
Member Author

rjernst commented Dec 14, 2022

@grcevski I could not figure out a way to have a permanent test for this, since it involves static init that once it occurs cannot be undone. However, I was able to manually replicate the error in #91964 and it no longer occurs with this change.

@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM! Quite an interesting edge case!

@rjernst rjernst merged commit 2d6ff2c into elastic:main Dec 15, 2022
@rjernst rjernst deleted the logging/force_init branch December 15, 2022 15:46
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Dec 15, 2022
* Force init of Unbox in log4j

Some libaries have static initializers that require security manager
permissions. When this initialization occurs during normal operation, it
can cause security manager exceptions depending on where a logging call
is made.

This commit adds a place for static initialization of log4j utility
classes to be run, and specifically adds the Unbox class which wants to
read env vars.

closes elastic#91964
elasticsearchmachine pushed a commit that referenced this pull request Dec 15, 2022
* Force init of Unbox in log4j

Some libaries have static initializers that require security manager
permissions. When this initialization occurs during normal operation, it
can cause security manager exceptions depending on where a logging call
is made.

This commit adds a place for static initialization of log4j utility
classes to be run, and specifically adds the Unbox class which wants to
read env vars.

closes #91964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v8.6.1 v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elasticsearch ingest attachment node crashes

3 participants