This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/3.x by this push:
new 96f9ab8 Fix function clause in couch_replicator_scheduler_job
96f9ab8 is described below
commit 96f9ab839a6206e8c6e6f81c6fc41cd48b601eeb
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Thu Mar 3 18:31:33 2022 -0500
Fix function clause in couch_replicator_scheduler_job
`ibrowse` responses may crash the job process with a function clause in
`handle_info/2`. Ingore those with a note that aliases should hopefully fix
this issue in the future.
---
src/couch_replicator/src/couch_replicator_scheduler_job.erl | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/couch_replicator/src/couch_replicator_scheduler_job.erl
b/src/couch_replicator/src/couch_replicator_scheduler_job.erl
index 6d97117..7776366 100644
--- a/src/couch_replicator/src/couch_replicator_scheduler_job.erl
+++ b/src/couch_replicator/src/couch_replicator_scheduler_job.erl
@@ -344,7 +344,13 @@ handle_info(timeout, InitArgs) ->
% Shutdown state is used to pass extra info about why start failed.
ShutdownState = {error, Class, StackTop2, InitArgs},
{stop, {shutdown, ShutdownReason}, ShutdownState}
- end.
+ end;
+
+handle_info({Ref, Tuple}, State) when is_reference(Ref), is_tuple(Tuple) ->
+ % Ignore responses from timed-out or retried ibrowse calls. Aliases in
+ % Erlang 24 should help with this problem, so we should revisit this clause
+ % when we update our minimum Erlang version to >= 24.
+ {noreply, State}.
terminate(
normal,