This is an automated email from the ASF dual-hosted git repository.

iilyak pushed a commit to branch retry-on-noproc-errors
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 02e3a2fbe9b7ca44d7a2d2b98cc4bce2b9b4eb76
Author: ILYA Khlopotov <[email protected]>
AuthorDate: Fri Sep 12 06:34:58 2025 -0700

    Add delay before retry
---
 src/dreyfus/src/dreyfus_rpc.erl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/dreyfus/src/dreyfus_rpc.erl b/src/dreyfus/src/dreyfus_rpc.erl
index b3f394c87..28f1ecba2 100644
--- a/src/dreyfus/src/dreyfus_rpc.erl
+++ b/src/dreyfus/src/dreyfus_rpc.erl
@@ -17,6 +17,8 @@
 -include("dreyfus.hrl").
 -import(couch_query_servers, [get_os_process/1, ret_os_process/1, 
proc_prompt/2]).
 
+-define(RETRY_DELAY, 280).
+
 % public api.
 -export([search/4, group1/4, group2/4, info/3, disk_size/3]).
 
@@ -50,6 +52,7 @@ call(Fun, DbName, DDoc, IndexName, QueryArgs0) ->
                 rexi:reply(index_call(Fun, DbName, Index, QueryArgs, MinSeq))
             catch
                 exit:{noproc, _} ->
+                    timer:sleep(?RETRY_DELAY),
                     %% try one more time to handle the case when Clouseau's LRU
                     %% closed the index in the middle of our call
                     rexi:reply(index_call(Fun, DbName, Index, QueryArgs, 
MinSeq))

Reply via email to