Skip to content
Snippets Groups Projects
Commit 39d3bc62 authored by felixcheung's avatar felixcheung Committed by Shivaram Venkataraman
Browse files

[SPARK-14594][SPARKR] check execution return status code

## What changes were proposed in this pull request?

When JVM backend fails without going proper error handling (eg. process crashed), the R error message could be ambiguous.

```
Error in if (returnStatus != 0) { : argument is of length zero
```

This change attempts to make it more clear (however, one would still need to investigate why JVM fails)

## How was this patch tested?

manually

Author: felixcheung <felixcheung_m@hotmail.com>

Closes #12622 from felixcheung/rreturnstatus.
parent 6acc72a0
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,9 @@ invokeJava <- function(isStatic, objId, methodName, ...) {
# TODO: check the status code to output error information
returnStatus <- readInt(conn)
if (length(returnStatus) == 0) {
stop("No status is returned. Java SparkR backend might have failed.")
}
if (returnStatus != 0) {
stop(readString(conn))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment