summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@gmail.com>2022-03-03 18:31:33 -0500
committerNick Vatamaniuc <nickva@users.noreply.github.com>2022-03-04 14:28:12 -0500
commit96f9ab839a6206e8c6e6f81c6fc41cd48b601eeb (patch)
tree0e4d27f66fbae35ded8a1b55c4de250bf5dfb9b6
parente4b8a4624fc7ae09b4649aac9a8d68226208cd8b (diff)
downloadcouchdb-96f9ab839a6206e8c6e6f81c6fc41cd48b601eeb.tar.gz
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.
-rw-r--r--src/couch_replicator/src/couch_replicator_scheduler_job.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/couch_replicator/src/couch_replicator_scheduler_job.erl b/src/couch_replicator/src/couch_replicator_scheduler_job.erl
index 6d9711790..777636691 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,