spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiva...@apache.org
Subject spark git commit: [SPARK-14594][SPARKR] check execution return status code
Date Sat, 23 Apr 2016 18:08:23 GMT
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 <felixcheung_m@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 <felixcheung_m@hotmail.com>
Authored: Sat Apr 23 11:08:19 2016 -0700
Committer: Shivaram Venkataraman <shivaram@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


Mime
View raw message