Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nativeaccess: try to load all located libsystemds #108238

Merged
merged 9 commits into from May 8, 2024

Conversation

axw
Copy link
Member

@axw axw commented May 3, 2024

Linux systems with multiarch (e.g. i386 & x86_64) libraries may have libsystemd.0 in two subdirectories of an entry in java.library.path. For example, libsystemd.so.0 may be found in both /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu.

Instead of attempting to load any library found, attempt all and stop as soon as one is successfully loaded.

Fixes #107878

Linux systems with multiarch (e.g. i386 & x86_64) libraries
may have libsystemd.0 in two subdirectories of an entry in
java.library.path. For example, libsystemd.so.0 may be found
in both /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu.

Instead of attempting to load any library found, attempt all
and stop as soon as one is successfully loaded.
@axw axw added >bug :Core/Infra/Core Core issues without another label labels May 3, 2024
@axw axw requested a review from a team as a code owner May 3, 2024 08:58
@elasticsearchmachine elasticsearchmachine added v8.15.0 Team:Core/Infra Meta label for core/infra team labels May 3, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

Thanks! looks good to me, but I'd ask @rjernst for a second look.

@axw axw requested a review from rjernst May 3, 2024 10:25
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

The general pattern of trying multiple paths seems ok, but I would like to keep a separation of loading from identifying possible paths. Could we please keep the method findLibSystemd, but change it to return a List? Then that can be looped over in the same static block that already tries to load.

@axw axw requested a review from rjernst May 5, 2024 09:27
@rjernst
Copy link
Member

rjernst commented May 7, 2024

@axw One of test failures is due to tabs being present, can you please check indentation is with spaces?

@rjernst
Copy link
Member

rjernst commented May 7, 2024

@elasticsearchmachine update branch

@axw
Copy link
Member Author

axw commented May 7, 2024

😢 so many different lint/check/spotless apply commands. Working on it, sorry.

@axw
Copy link
Member Author

axw commented May 8, 2024

@rjernst all good now, sorry for that. PTAL.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @axw

@rjernst rjernst added v8.14.1 auto-backport-and-merge Automatically create backport pull requests and merge when ready labels May 8, 2024
@rjernst rjernst merged commit 5a622b0 into elastic:main May 8, 2024
15 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.14

axw added a commit to axw/elasticsearch that referenced this pull request May 8, 2024
Linux systems with multiarch (e.g. i386 & x86_64) libraries
may have libsystemd.0 in two subdirectories of an entry in
java.library.path. For example, libsystemd.so.0 may be found
in both /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu.

Instead of attempting to load any library found, attempt all
and stop as soon as one is successfully loaded.
elasticsearchmachine pushed a commit that referenced this pull request May 8, 2024
Linux systems with multiarch (e.g. i386 & x86_64) libraries
may have libsystemd.0 in two subdirectories of an entry in
java.library.path. For example, libsystemd.so.0 may be found
in both /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu.

Instead of attempting to load any library found, attempt all
and stop as soon as one is successfully loaded.
@axw axw deleted the nativeaccess-systemd-multiarch branch May 9, 2024 01:08
markjhoy pushed a commit to markjhoy/elasticsearch that referenced this pull request May 9, 2024
Linux systems with multiarch (e.g. i386 & x86_64) libraries
may have libsystemd.0 in two subdirectories of an entry in
java.library.path. For example, libsystemd.so.0 may be found
in both /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu.

Instead of attempting to load any library found, attempt all
and stop as soon as one is successfully loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-and-merge Automatically create backport pull requests and merge when ready >bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team v8.14.1 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch fails to start with both 32 bit and 64 bit libsystemd installed
4 participants