-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][test] Remove conscrypt exception stacktrace in Apple silicon #18359
[improve][test] Remove conscrypt exception stacktrace in Apple silicon #18359
Conversation
@@ -124,7 +124,12 @@ private static Provider loadConscryptProvider() { | |||
conscryptClazz = Class.forName("org.conscrypt.Conscrypt"); | |||
conscryptClazz.getMethod("checkAvailability").invoke(null); | |||
} catch (Throwable e) { | |||
log.warn("Conscrypt isn't available. Using JDK default security provider.", e); | |||
if (e.getCause() != null && e.getCause().getClass().getName().equals("java.lang.UnsatisfiedLinkError")) { |
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.
Could we use debug
instead of warn
?
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.
It's better to use level warn
because it is a exception — not a If - else
or something needs to record. This warn
means conscrypt is not supported which needs to remind.
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.
If you want to avoid the too-long message, I suggest you just output the message and then add a debug log to print the stack trace.
pulsar-common/src/main/java/org/apache/pulsar/common/util/SecurityUtility.java
Outdated
Show resolved
Hide resolved
…rityUtility.java Co-authored-by: Cong Zhao <zhaocong@apache.org>
/pulsarbot run-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #18359 +/- ##
============================================
+ Coverage 40.29% 47.91% +7.62%
- Complexity 8685 9352 +667
============================================
Files 687 613 -74
Lines 67441 58391 -9050
Branches 7225 6087 -1138
============================================
+ Hits 27175 27979 +804
+ Misses 37257 27386 -9871
- Partials 3009 3026 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
LGTM. One code quality suggestion inline.
@@ -124,7 +124,12 @@ private static Provider loadConscryptProvider() { | |||
conscryptClazz = Class.forName("org.conscrypt.Conscrypt"); | |||
conscryptClazz.getMethod("checkAvailability").invoke(null); | |||
} catch (Throwable e) { | |||
log.warn("Conscrypt isn't available. Using JDK default security provider.", e); | |||
if (e.getCause() instanceof UnsatisfiedLinkError) { |
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.
@codelipenghui @nodece Do we have an exception util like Flink's findThrowable
? I'm afraid that the error may be changed to differ wrap level.
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.
No.
/pulsarbot run-failure-checks |
Motivation
When running tests in Macos Apple silicon, there will be a long stacktrace like this
There's no osx aarch_64 conscrypt, so we can filter this stacktrace by catching
java.lang.UnsatisfiedLinkError
.Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/yaalsn/pulsar/pull/16