couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to 8924e94
Date Fri, 09 Oct 2015 11:14:39 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master 33bc06086 -> 8924e94eb


Handle view server crashing during test compile of view functions.

Due to how libmozjs185 library is compiled on Ubuntu 12.04, given
invalid JS code, it will not return with expected error result:

 ["error","compilation_error",...]

but will crash. Otherwise library seems functional --  it passes
all other mrview tests.

Handle this crash in try_compile() function as a compilation
failure. Error message contains the exit status of the view process
to help debugging.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/8924e94e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/8924e94e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/8924e94e

Branch: refs/heads/master
Commit: 8924e94eb986ee39e69f61f617a907a129fd0123
Parents: 33bc060
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Thu Oct 8 15:21:59 2015 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Thu Oct 8 22:11:19 2015 -0400

----------------------------------------------------------------------
 src/couch_query_servers.erl | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8924e94e/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index 4882f9e..97884c2 100644
--- a/src/couch_query_servers.erl
+++ b/src/couch_query_servers.erl
@@ -38,10 +38,15 @@ try_compile(Proc, FunctionType, FunctionName, FunctionSource) ->
     try
         proc_prompt(Proc, [<<"add_fun">>, FunctionSource]),
         ok
-    catch {compilation_error, E} ->
-        Fmt = "Compilation of the ~s function in the '~s' view failed: ~s",
-        Msg = io_lib:format(Fmt, [FunctionType, FunctionName, E]),
-        throw({compilation_error, Msg})
+    catch
+        {compilation_error, E} ->
+            Fmt = "Compilation of the ~s function in the '~s' view failed: ~s",
+            Msg = io_lib:format(Fmt, [FunctionType, FunctionName, E]),
+            throw({compilation_error, Msg});
+        {os_process_error, {exit_status, ExitStatus}} ->
+            Fmt = "Compilation of the ~s function in the '~s' view failed with exit status:
~p",
+            Msg = io_lib:format(Fmt, [FunctionType, FunctionName, ExitStatus]),
+            throw({compilation_error, Msg})
     end.
 
 start_doc_map(Lang, Functions, Lib) ->


Mime
View raw message