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
Try to load native linux libraries with matching classifier first #9411
Conversation
Can one of the admins verify this patch? |
@netty-bot test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address comments and also rebase
return Collections.unmodifiableSet(LINUX_OS_CLASSIFIERS); | ||
} | ||
|
||
private static void addClassifier(HashSet<String> allowedClassifiers, String... split) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Set
final String[] OS_RELEASE_FILES = {"/etc/os-release", "/usr/lib/os-release"}; | ||
final String LINUX_ID_PREFIX = "ID="; | ||
final String LINUX_ID_LIKE_PREFIX = "ID_LIKE="; | ||
final HashSet<String> allowedClassifiers = new HashSet<String>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Set
@@ -1274,6 +1329,23 @@ public static String normalizedOs() { | |||
return NORMALIZED_OS; | |||
} | |||
|
|||
public static Set<String> normalizedLinuxClassifiers() { | |||
return Collections.unmodifiableSet(LINUX_OS_CLASSIFIERS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not create this once in the static method and return the same instance all the time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea - I'll do it in the static initializer though
@@ -97,6 +106,10 @@ | |||
private static final String NORMALIZED_ARCH = normalizeArch(SystemPropertyUtil.get("os.arch", "")); | |||
private static final String NORMALIZED_OS = normalizeOs(SystemPropertyUtil.get("os.name", "")); | |||
|
|||
// keep in sync with maven builds! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also add a comment that this is defined in pom.xml ?
Motivation: Users' runtime systems may have incompatible dynamic libraries to the ones our tcnative wrappers link to. Unfortunately, we cannot determine and catch these scenarios (in which the JVM crashes) but we can make a more educated guess on what library to load and try to find one that works better before crashing. Modifications: 1) Build dynamically linked openSSL builds for more OSs (netty-tcnative) 2) Load native linux libraries with matching classifier (first) Result: More developers / users can use the dynamically-linked native libraries.
thanks for the review, I believe, I have addressed your comments now |
@normanmaurer can you give me a hint for what the next steps are? We probably need to create new docker files for the new distributions but is that enough then to get release artifacts? |
@netty-bot test this please |
@NicoK I need to think about how to process after this to make sure we also release extra native artefacts. |
) Motivation: Users' runtime systems may have incompatible dynamic libraries to the ones our tcnative wrappers link to. Unfortunately, we cannot determine and catch these scenarios (in which the JVM crashes) but we can make a more educated guess on what library to load and try to find one that works better before crashing. Modifications: 1) Build dynamically linked openSSL builds for more OSs (netty-tcnative) 2) Load native linux libraries with matching classifier (first) Result: More developers / users can use the dynamically-linked native libraries.
Motivation:
Users' runtime systems may have incompatible dynamic libraries to the ones our
tcnative wrappers link to. Unfortunately, we cannot determine and catch these
scenarios (in which the JVM crashes) but we can make a more educated guess on
what library to load and try to find one that works better before crashing.
Modifications:
Based on #9410 and netty/netty-tcnative#480, this PR adds:
Result:
More developers / users can use the dynamically-linked native libraries.
This change is