Permalink
Browse files

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.
  • Loading branch information...
1 parent 1cea79d commit bf014ecdb196ab7f170855734f2572e87ebd0cb7 @fdmanana fdmanana committed with Robert Newson Nov 4, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 apps/couch/src/couch_os_process.erl
  2. +3 −3 apps/couch/src/couch_query_servers.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) ->
@@ -246,7 +246,7 @@ proc_set_timeout(Proc, Timeout) ->
get_ddoc_process(#doc{} = DDoc, DDocKey) ->
% remove this case statement
- case gen_server:call(couch_proc_manager, {get_proc, DDoc, DDocKey}) of
+ case gen_server:call(couch_proc_manager, {get_proc, DDoc, DDocKey}, infinity) of
{ok, Proc, QueryConfig} ->
% process knows the ddoc
case (catch proc_prompt(Proc, [<<"reset">>, QueryConfig])) of
@@ -263,7 +263,7 @@ get_ddoc_process(#doc{} = DDoc, DDocKey) ->
end.
get_os_process(Lang) ->
- case gen_server:call(couch_proc_manager, {get_proc, Lang}) of
+ case gen_server:call(couch_proc_manager, {get_proc, Lang}, infinity) of
{ok, Proc, QueryConfig} ->
case (catch proc_prompt(Proc, [<<"reset">>, QueryConfig])) of
true ->
@@ -279,6 +279,6 @@ get_os_process(Lang) ->
end.
ret_os_process(Proc) ->
- true = gen_server:call(couch_proc_manager, {ret_proc, Proc}),
+ true = gen_server:call(couch_proc_manager, {ret_proc, Proc}, infinity),
catch unlink(Proc#proc.pid),
ok.

0 comments on commit bf014ec

Please sign in to comment.