You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sh...@apache.org on 2016/04/23 20:08:23 UTC
spark git commit: [SPARK-14594][SPARKR] check execution return status
code
Repository: spark
Updated Branches:
refs/heads/master 6acc72a02 -> 39d3bc62a
[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 <fe...@hotmail.com>
Closes #12622 from felixcheung/rreturnstatus.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/39d3bc62
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/39d3bc62
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/39d3bc62
Branch: refs/heads/master
Commit: 39d3bc62a7ba16c646bed8d524cf9b929374a790
Parents: 6acc72a
Author: felixcheung <fe...@hotmail.com>
Authored: Sat Apr 23 11:08:19 2016 -0700
Committer: Shivaram Venkataraman <sh...@cs.berkeley.edu>
Committed: Sat Apr 23 11:08:19 2016 -0700
----------------------------------------------------------------------
R/pkg/R/backend.R | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/39d3bc62/R/pkg/R/backend.R
----------------------------------------------------------------------
diff --git a/R/pkg/R/backend.R b/R/pkg/R/backend.R
index 4916283..6c81492 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))
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org