Fix purge request timeouts main
authorNick Vatamaniuc <vatamane@gmail.com>
Tue, 9 Aug 2022 22:00:42 +0000 (18:00 -0400)
committerJan Lehnardt <jan@apache.org>
Wed, 10 Aug 2022 08:32:01 +0000 (10:32 +0200)
Don't rely on the default gen_server 5 second timeout.

Use `infinity` as that's also effectively used for doc updates.

Fixes https://github.com/apache/couchdb/issues/4142

src/couch/src/couch_db.erl

index 3c4f1edec619dcae345db41b0292cf5180aa047c..dd7e07517c187d232c20b2bd4c4828e68317036a 100644 (file)
@@ -432,7 +432,7 @@ purge_docs(#db{main_pid = Pid} = Db, UUIDsIdsRevs, Options) ->
             {ok, []};
         [_ | _] ->
             increment_stat(Db, [couchdb, database_purges]),
             {ok, []};
         [_ | _] ->
             increment_stat(Db, [couchdb, database_purges]),
-            gen_server:call(Pid, {purge_docs, UUIDsIdsRevs2, Options})
+            gen_server:call(Pid, {purge_docs, UUIDsIdsRevs2, Options}, infinity)
     end.
 
 -spec get_purge_infos(#db{}, [UUId]) -> [PurgeInfo] when
     end.
 
 -spec get_purge_infos(#db{}, [UUId]) -> [PurgeInfo] when