Skip to content

Error handling improvements #2063

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

Merged
merged 1 commit into from
Sep 8, 2016

Conversation

nrgraham23
Copy link
Contributor

This commit improves and corrects error handling. In
cases where existing objects are altered after a call
to ompi_java_exceptionCheck, the results of the exception
check method are checked. In the case of an exception,
memory is cleaned up and the code returns to Java without
altering existing objects.

Signed-off-by: Nathaniel Graham [email protected]

Fixes #1698

@hppritcha please review this when you get a chance.

@lanl-ompi
Copy link
Contributor

Test FAILed.

@nrgraham23 nrgraham23 added this to the v2.1.0 milestone Sep 7, 2016
@hppritcha
Copy link
Member

looks good but please update the LANL copyright lines on the changed files.

This commit improves and corrects error handling.  In
cases where existing objects are altered after a call
to ompi_java_exceptionCheck, the results of the exception
check method are checked.  In the case of an exception,
memory is cleaned up and the code returns to Java without
altering existing objects.

Signed-off-by: Nathaniel Graham <[email protected]>
@nrgraham23 nrgraham23 merged commit 745872e into open-mpi:master Sep 8, 2016
@siegmargross
Copy link

Thank you very much for the fix. With the following addition to your version of the exception program, I get what I want. I found the solution for the root cause on stackoverflow.

catch (IndexOutOfBoundsException e) {
  System.err.println("Handle index out of bounds here");
  /* Try to find the root cause for the exception                   */
  Throwable cause = null; 
  Throwable result = e;
  while (null != (cause = result.getCause()) && (result != cause))  {
    result = cause;
  }
  System.err.printf ("  Process %2d: Error message: %s\n",  mytid, result);
}

@nrgraham23 nrgraham23 deleted the check_exceptionCheck branch November 16, 2016 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants