From c978b6168bb8a11c7182444a9f4bf2e9bb1a18fb Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 13 Dec 2018 09:46:57 -0600 Subject: [PATCH 1/2] Don't log when queue is unavailable Fixes #1223 For large chains like ETH Mainnet, it is fairly common for the catchup fetcher to take a long time to calculate the missing block numbers and start the named Sequence used by `push_front(block)`. Since this is normal and not exceptional, `InvalidConsensus.Worker` shouldn't log this and retry silently. --- apps/indexer/lib/indexer/block/invalid_consensus/worker.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/indexer/lib/indexer/block/invalid_consensus/worker.ex b/apps/indexer/lib/indexer/block/invalid_consensus/worker.ex index 1ca83a6dfe..cbe93c604b 100644 --- a/apps/indexer/lib/indexer/block/invalid_consensus/worker.ex +++ b/apps/indexer/lib/indexer/block/invalid_consensus/worker.ex @@ -77,7 +77,10 @@ defmodule Indexer.Block.InvalidConsensus.Worker do end def handle_info({ref, {:error, reason}}, %{task_ref: ref, retry_interval: millis} = state) do - Logger.error(fn -> inspect(reason) end) + case reason do + :queue_unavailable -> :ok + _ -> Logger.error(fn -> inspect(reason) end) + end Process.demonitor(ref, [:flush]) Process.send_after(self(), :push_front_blocks, millis) From 6a0f625da7414dde5ddf17a9f4e119ac01ca1410 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Thu, 13 Dec 2018 10:00:09 -0600 Subject: [PATCH 2/2] Port fix for InvalidConsensus to Uncataloged They have a similar style where Uncataloged could also receive :queue_unavailable. --- .../indexer/lib/indexer/token_transfer/uncataloged/worker.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/indexer/lib/indexer/token_transfer/uncataloged/worker.ex b/apps/indexer/lib/indexer/token_transfer/uncataloged/worker.ex index 0d053895ee..8bc689cf9d 100644 --- a/apps/indexer/lib/indexer/token_transfer/uncataloged/worker.ex +++ b/apps/indexer/lib/indexer/token_transfer/uncataloged/worker.ex @@ -76,7 +76,10 @@ defmodule Indexer.TokenTransfer.Uncataloged.Worker do end def handle_info({ref, {:error, reason}}, %{task_ref: ref, retry_interval: millis} = state) do - Logger.error(fn -> inspect(reason) end) + case reason do + :queue_unavailable -> :ok + _ -> Logger.error(fn -> inspect(reason) end) + end Process.demonitor(ref, [:flush]) Process.send_after(self(), :push_front_blocks, millis)