You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2022/07/06 11:57:00 UTC

[jira] [Resolved] (ARROW-16329) [Java][C++] Keep more context when marshalling errors through JNI

     [ https://issues.apache.org/jira/browse/ARROW-16329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Li resolved ARROW-16329.
------------------------------
    Resolution: Fixed

Issue resolved by pull request 13246
[https://github.com/apache/arrow/pull/13246]

> [Java][C++] Keep more context when marshalling errors through JNI
> -----------------------------------------------------------------
>
>                 Key: ARROW-16329
>                 URL: https://issues.apache.org/jira/browse/ARROW-16329
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++, Java
>            Reporter: Antoine Pitrou
>            Assignee: Hongze Zhang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 9.0.0
>
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> When errors are propagated through the JNI barrier, two mechanisms are involved:
> * the {{Status CheckException(JNIEnv* env)}} function for Java-to-C++ error translation
> * the {{JniAssertOkOrThrow(arrow::Status status)}} and {{T JniGetOrThrow(arrow::Result<T> result)}} functions for C++-to-Java error translation
> Currently, both mechanisms lose most context about the original error, such as its type and any additional state, such as the optional {{StatusDetail}} in C++ or any properties in Java (which I'm sure exist on some exception classes).
> We should improve these mechanisms to retain as much context as possible. For example, in a hypothetical Java-to-C++-to-Java error propagation scenario, the original Java exception from inner code should ideally be re-thrown in the outer Java context (we already support this in Python btw).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)