fetch_and_import_range_from_sequence log exceptions instead of raise

Fixes #1234

Raising the exception will kill all Tasks, the sequence and the fetcher
because of the linking from `Task.async_stream`.  This leads to when 1
Task times out in a DB transaction, they all are affected, leading to
slowdowns when the sequence has to be rebuilt when the fetcher restarts.
pull/1235/head
Luke Imhoff 6 years ago
parent 285d8f410c
commit cbe3308c3d
  1. 7
      apps/indexer/lib/indexer/block/catchup/fetcher.ex

@ -220,6 +220,13 @@ defmodule Indexer.Block.Catchup.Fetcher do
error
end
rescue
exception ->
Logger.error(fn -> [Exception.format(:error, exception, __STACKTRACE__), ?\n, ?\n, "Retrying."] end)
push_back(sequence, range)
{:error, exception}
end
defp cap_seq(seq, errors) do

Loading…
Cancel
Save