diff options
author | felixcheung <felixcheung_m@hotmail.com> | 2016-04-23 11:08:19 -0700 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2016-04-23 11:08:19 -0700 |
commit | 39d3bc62a7ba16c646bed8d524cf9b929374a790 (patch) | |
tree | 6bf5721c393ff47f1108e7ef7c8e5f46fff182c1 | |
parent | 6acc72a02961982f217ceaea5bde4eca4e2d7db8 (diff) | |
download | spark-39d3bc62a7ba16c646bed8d524cf9b929374a790.tar.gz spark-39d3bc62a7ba16c646bed8d524cf9b929374a790.tar.bz2 spark-39d3bc62a7ba16c646bed8d524cf9b929374a790.zip |
[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.
-rw-r--r-- | R/pkg/R/backend.R | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/R/pkg/R/backend.R b/R/pkg/R/backend.R index 49162838b8..6c81492f8b 100644 --- a/R/pkg/R/backend.R +++ b/R/pkg/R/backend.R @@ -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)) } |