-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-16566: [Java] Initialize JNI components on use instead of statically #13146
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
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW Opening JIRAs ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename pull request title in the following format? or See also: |
|
|
|
|
Done |
|
Could you elaborate on
? |
| private final long nativeInstanceId; | ||
|
|
||
| static { | ||
| private static void ensureLoaded() { |
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.
Is there any reason not to inline this instead?
Thanks for your attension. Back to current PR, if it is killed when calling |
|
cc @lwhite1 , who has started working on various JNI aspects. |
|
@jackylee-ch Would you like to follow up on @lidavidm 's suggestion above? |
Sure. |
lidavidm
left a comment
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.
Thank you!
…cally (apache#13146) We are using Arrow in Spark. When speculation is turned on, it is possible for the task to be forcibly killed during the running process. It means, `JniLoader.get().ensureLoaded()` maybe failed with `ClosedByInterruptException` when the task was killed, and it should be accepted with this. However, `NativeMemoryPool` use it as a static code, this leads to an init failure every time the NativeMemroyPool is trying to initialized and can never succeed. It would always fail to init `NativeMemoryPool` with `java.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.dataset.jni.NativeMemoryPool`. Lead-authored-by: jackylee-ch <[email protected]> Co-authored-by: stczwd <[email protected]> Signed-off-by: David Li <[email protected]>
…cally (apache#13146) (#119) We are using Arrow in Spark. When speculation is turned on, it is possible for the task to be forcibly killed during the running process. It means, `JniLoader.get().ensureLoaded()` maybe failed with `ClosedByInterruptException` when the task was killed, and it should be accepted with this. However, `NativeMemoryPool` use it as a static code, this leads to an init failure every time the NativeMemroyPool is trying to initialized and can never succeed. It would always fail to init `NativeMemoryPool` with `java.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.dataset.jni.NativeMemoryPool`. Lead-authored-by: jackylee-ch <[email protected]> Co-authored-by: stczwd <[email protected]> Signed-off-by: David Li <[email protected]>
…cally (apache#13146) We are using Arrow in Spark. When speculation is turned on, it is possible for the task to be forcibly killed during the running process. It means, `JniLoader.get().ensureLoaded()` maybe failed with `ClosedByInterruptException` when the task was killed, and it should be accepted with this. However, `NativeMemoryPool` use it as a static code, this leads to an init failure every time the NativeMemroyPool is trying to initialized and can never succeed. It would always fail to init `NativeMemoryPool` with `java.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.dataset.jni.NativeMemoryPool`. Lead-authored-by: jackylee-ch <[email protected]> Co-authored-by: stczwd <[email protected]> Signed-off-by: David Li <[email protected]>
We are using Arrow in Spark. When speculation is turned on, it is possible for the task to be forcibly killed during the running process. It means,
JniLoader.get().ensureLoaded()maybe failed withClosedByInterruptExceptionwhen the task was killed, and it should be accepted with this.However,
NativeMemoryPooluse it as a static code, this leads to an init failure every time the NativeMemroyPool is trying to initialized and can never succeed. It would always fail to initNativeMemoryPoolwithjava.lang.NoClassDefFoundError: Could not initialize class org.apache.arrow.dataset.jni.NativeMemoryPool.