You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/11/04 17:48:19 UTC
git commit: Set gen_server call timeouts to infinity
Updated Branches:
refs/heads/master 02894cfb7 -> 2190ff008
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/2190ff00
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/2190ff00
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/2190ff00
Branch: refs/heads/master
Commit: 2190ff008c3c701e603c128f7effa9cae4897107
Parents: 02894cf
Author: Filipe David Borba Manana <fd...@apache.org>
Authored: Fri Nov 4 15:41:35 2011 +0000
Committer: Filipe David Borba Manana <fd...@apache.org>
Committed: Fri Nov 4 15:41:35 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/2190ff00/src/couchdb/couch_os_process.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_os_process.erl b/src/couchdb/couch_os_process.erl
index 8b22ec5..ae2f8b6 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/2190ff00/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.