couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject git commit: Set gen_server call timeouts to infinity
Date Fri, 04 Nov 2011 16:49:57 GMT
Updated Branches:
  refs/heads/1.2.x 2a821005a -> e851067df


Set gen_server call timeouts to infinity

When a server is too busy, the default call timeout of
5 seconds may not be enough when getting an OS process
to execute JavaScript code.
Closes COUCHDB-1333.


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

Branch: refs/heads/1.2.x
Commit: e851067df0a70c60cd9a2645e05b2843286ddc4f
Parents: 2a82100
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Fri Nov 4 15:41:35 2011 +0000
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Fri Nov 4 16:40:22 2011 +0000

----------------------------------------------------------------------
 src/couchdb/couch_os_process.erl    |    2 +-
 src/couchdb/couch_query_servers.erl |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e851067d/src/couchdb/couch_os_process.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_os_process.erl b/src/couchdb/couch_os_process.erl
index 415cdbb..1c0a6f9 100644
--- a/src/couchdb/couch_os_process.erl
+++ b/src/couchdb/couch_os_process.erl
@@ -42,7 +42,7 @@ stop(Pid) ->
 
 % Read/Write API
 set_timeout(Pid, TimeOut) when is_integer(TimeOut) ->
-    ok = gen_server:call(Pid, {set_timeout, TimeOut}).
+    ok = gen_server:call(Pid, {set_timeout, TimeOut}, infinity).
 
 % Used by couch_db_update_notifier.erl
 send(Pid, Data) ->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e851067d/src/couchdb/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl
index 15a562c..03f2012 100644
--- a/src/couchdb/couch_query_servers.erl
+++ b/src/couchdb/couch_query_servers.erl
@@ -542,14 +542,14 @@ teach_ddoc(DDoc, {DDocId, _Rev}=DDocKey, #proc{ddoc_keys=Keys}=Proc)
->
 
 get_ddoc_process(#doc{} = DDoc, DDocKey) ->
     % remove this case statement
-    case gen_server:call(couch_query_servers, {get_proc, DDoc, DDocKey}) of
+    case gen_server:call(couch_query_servers, {get_proc, DDoc, DDocKey}, infinity) of
     {ok, Proc, {QueryConfig}} ->
         % process knows the ddoc
         case (catch proc_prompt(Proc, [<<"reset">>, {QueryConfig}])) of
         true ->
             proc_set_timeout(Proc, couch_util:get_value(<<"timeout">>, QueryConfig)),
             link(Proc#proc.pid),
-            gen_server:call(couch_query_servers, {unlink_proc, Proc#proc.pid}),
+            gen_server:call(couch_query_servers, {unlink_proc, Proc#proc.pid}, infinity),
             Proc;
         _ ->
             catch proc_stop(Proc),
@@ -560,13 +560,13 @@ get_ddoc_process(#doc{} = DDoc, DDocKey) ->
     end.
 
 get_os_process(Lang) ->
-    case gen_server:call(couch_query_servers, {get_proc, Lang}) of
+    case gen_server:call(couch_query_servers, {get_proc, Lang}, infinity) of
     {ok, Proc, {QueryConfig}} ->
         case (catch proc_prompt(Proc, [<<"reset">>, {QueryConfig}])) of
         true ->
             proc_set_timeout(Proc, couch_util:get_value(<<"timeout">>, QueryConfig)),
             link(Proc#proc.pid),
-            gen_server:call(couch_query_servers, {unlink_proc, Proc#proc.pid}),
+            gen_server:call(couch_query_servers, {unlink_proc, Proc#proc.pid}, infinity),
             Proc;
         _ ->
             catch proc_stop(Proc),
@@ -577,7 +577,7 @@ get_os_process(Lang) ->
     end.
 
 ret_os_process(Proc) ->
-    true = gen_server:call(couch_query_servers, {ret_proc, Proc}),
+    true = gen_server:call(couch_query_servers, {ret_proc, Proc}, infinity),
     catch unlink(Proc#proc.pid),
     ok.
 


Mime
View raw message