Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase main db timeout + logging tweaks #1017

Merged
merged 24 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cacd24e
Set org runners for helmfile.
rkachowski Dec 14, 2023
a25b64c
Remove incompatible fields.
rkachowski Dec 14, 2023
eea56a4
Use helm runner.
rkachowski Dec 14, 2023
24bc5bc
Add logging to repo_helper to get timing info.
rkachowski Jan 18, 2024
245b6db
Increase timeout for token balance fetcher + production db connection…
rkachowski Jan 23, 2024
808db90
Revert "Add logging to repo_helper to get timing info."
rkachowski Jan 25, 2024
b218b0f
Merge branch 'master' into dhutch/wip_token_balances_fix
rkachowski Jan 25, 2024
eb21f5f
Use blockscout runners.
rkachowski Jan 25, 2024
b3e101c
Increase timeouts further.
rkachowski Feb 1, 2024
4339f9c
Merge branch 'master' into dhutch/wip_token_balances_fix
rkachowski Feb 1, 2024
121ce23
Merge remote-tracking branch 'origin/dhutch/wip_token_balances_fix' i…
rkachowski Feb 1, 2024
87d0228
Merge branch 'master' into dhutch/wip_token_balances_fix
rkachowski Feb 1, 2024
a4d0d50
Run on 8-cpu runners.
rkachowski Feb 1, 2024
85cddda
Merge remote-tracking branch 'origin/dhutch/wip_token_balances_fix' i…
rkachowski Feb 1, 2024
9e6ed1f
Log missing block ranges.
rkachowski Feb 1, 2024
a479784
Reduce block fetch concurrency.
rkachowski Feb 1, 2024
b85a2e6
Remove noisy sanitizer log.
rkachowski Feb 1, 2024
91b50f0
Reorder runner labels.
rkachowski Feb 1, 2024
233ef26
Suppress logs + revert remote script.
rkachowski Feb 5, 2024
f253a63
More logging tweaks.
rkachowski Feb 6, 2024
effa6b2
Format.
rkachowski Feb 6, 2024
a5a0b72
Set transaction cache lock timeout to 30 seconds.
rkachowski Feb 6, 2024
32dd1b2
Don't update tx cache from indexer.
rkachowski Feb 6, 2024
21306eb
Fix unused variable.
rkachowski Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/blockscout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
jobs:
build-and-cache:
name: Build and Cache deps
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: [ '8-cpu','self-hosted', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

credo:
name: Credo
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand All @@ -121,7 +121,7 @@ jobs:

check_formatted:
name: Code formatting checks
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand All @@ -147,7 +147,7 @@ jobs:
- run: mix format --check-formatted
dialyzer:
name: Dialyzer static analysis
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:

gettext:
name: Missing translation keys check
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
working-directory: "apps/block_scout_web"
sobelow:
name: Sobelow security analysis
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
working-directory: "apps/block_scout_web"
eslint:
name: ESLint
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:

jest:
name: JS Tests
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -355,7 +355,7 @@ jobs:

test_nethermind_mox_ethereum_jsonrpc:
name: EthereumJSONRPC Tests
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -423,7 +423,7 @@ jobs:
path: _build/test/junit/ethereum_jsonrpc/*.xml
test_nethermind_mox_explorer:
name: Explorer Tests
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -512,7 +512,7 @@ jobs:
path: _build/test/junit/explorer/*.xml
test_nethermind_mox_indexer:
name: Indexer Tests
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -585,7 +585,7 @@ jobs:

test_nethermind_mox_block_scout_web:
name: Blockscout Web Tests
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
options: --user root
Expand Down Expand Up @@ -702,7 +702,7 @@ jobs:

publish-test-results:
name: "Publish Unit Tests Results"
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
needs:
Expand All @@ -724,7 +724,7 @@ jobs:
files: artifacts/**/*.xml

set-docker-vars:
runs-on: ['self-hosted', 'org', '8-cpu']
runs-on: ['self-hosted', '8-cpu', 'blockscout']
container:
image: us-west1-docker.pkg.dev/devopsre/actions-runner-controller/blockscout:latest
needs: [credo, check_formatted, dialyzer, gettext, sobelow, eslint, jest, test_nethermind_mox_ethereum_jsonrpc, test_nethermind_mox_explorer, test_nethermind_mox_indexer, test_nethermind_mox_block_scout_web]
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Config
# Configures the database
config :explorer, Explorer.Repo.Local,
prepare: :unnamed,
timeout: :timer.seconds(60),
timeout: :timer.minutes(6),
migration_lock: nil,
telemetry_prefix: [:explorer, :repo]

Expand Down
1 change: 1 addition & 0 deletions apps/explorer/lib/explorer/chain/cache/transactions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defmodule Explorer.Chain.Cache.Transactions do
token_transfers: :from_address,
token_transfers: :to_address
],
acquire_lock_timeout: :timer.seconds(30),
ttl_check_interval: Application.get_env(:explorer, __MODULE__)[:ttl_check_interval],
global_ttl: Application.get_env(:explorer, __MODULE__)[:global_ttl]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Explorer.Chain.Import.Runner.Address.TokenBalances do
@behaviour Import.Runner

# milliseconds
@timeout 60_000
@timeout 300_000

@type imported :: [TokenBalance.t()]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Explorer.Chain.Import.Runner.ExchangeRate do
@behaviour Import.Runner

# milliseconds
@timeout 60_000
@timeout 30_000

@type imported :: [ExchangeRate.t()]

Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/lib/indexer/block/catchup/fetcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defmodule Indexer.Block.Catchup.Fetcher do
|> Stream.map(&Enum.count/1)
|> Enum.sum()

Logger.debug(fn -> "Missed blocks in ranges." end,
Logger.info(fn -> "Missed blocks in ranges." end,
missing_block_range_count: range_count,
missing_block_count: missing_block_count
)
Expand Down
8 changes: 5 additions & 3 deletions apps/indexer/lib/indexer/block/fetcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule Indexer.Block.Fetcher do
alias Explorer.Chain.{Address, Block, Hash, Import, Transaction, Wei}
alias Explorer.Chain.Block.Reward
alias Explorer.Chain.Cache.Blocks, as: BlocksCache
alias Explorer.Chain.Cache.{Accounts, BlockNumber, Transactions, Uncles}
alias Explorer.Chain.Cache.{Accounts, BlockNumber, Uncles}
alias Indexer.Block.Fetcher.Receipts

alias Explorer.Celo.Util
Expand Down Expand Up @@ -380,8 +380,10 @@ defmodule Indexer.Block.Fetcher do

defp update_block_cache(_), do: :ok

defp update_transactions_cache(transactions) do
Transactions.update(transactions)
defp update_transactions_cache(_transactions) do
# Celo - Indexer and Web are not using the same cache instance, no need to update here
# Transactions.update(transactions)
:ok
end

defp update_addresses_cache(addresses), do: Accounts.drop(addresses)
Expand Down
6 changes: 4 additions & 2 deletions apps/indexer/lib/indexer/block/realtime/fetcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,17 @@ defmodule Indexer.Block.Realtime.Fetcher do
end

{:error, {:import = step, reason}} ->
Logger.error(fn -> inspect(reason) end, step: step)
Logger.error(fn -> " Error #{inspect(block_number_to_fetch)} #{inspect(step)} - #{inspect(reason)}" end,
step: step
)

{:error, {step, reason}} ->
Logger.error(
fn ->
[
"failed to fetch: ",
inspect(reason),
". Block will be retried by catchup indexer."
". Block #{inspect(block_number_to_fetch)} will be retried by catchup indexer."
]
end,
step: step
Expand Down
6 changes: 3 additions & 3 deletions apps/indexer/lib/indexer/fetcher/empty_blocks_sanitizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule Indexer.Fetcher.EmptyBlocksSanitizer do
:sanitize_empty_blocks,
%{interval: interval, json_rpc_named_arguments: json_rpc_named_arguments} = state
) do
Logger.info("Start sanitizing of empty blocks. Batch size is #{limit()}",
Logger.debug("Start sanitizing of empty blocks. Batch size is #{limit()}",
fetcher: :empty_blocks_to_refetch
)

Expand Down Expand Up @@ -95,7 +95,7 @@ defmodule Indexer.Fetcher.EmptyBlocksSanitizer do
|> Enum.count()

if transactions_count > 0 do
Logger.info(
Logger.debug(
"Block with number #{block_number} and hash #{to_string(block_hash)} is full of transactions. We should set consensus=false for it in order to refetch.",
fetcher: :empty_blocks_to_refetch
)
Expand All @@ -112,7 +112,7 @@ defmodule Indexer.Fetcher.EmptyBlocksSanitizer do
end
end)

Logger.info("Batch of empty blocks is sanitized",
Logger.debug("Batch of empty blocks is sanitized",
fetcher: :empty_blocks_to_refetch
)
end
Expand Down
2 changes: 1 addition & 1 deletion apps/indexer/lib/indexer/fetcher/token_instance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule Indexer.Fetcher.TokenInstance do
result ->
Telemetry.event([:indexer, :nft, :ingestion_errors], %{count: 1})

Logger.error(
Logger.debug(
[
"failed to fetch token instance metadata for #{inspect({to_string(token_contract_address_hash), Decimal.to_integer(token_id)})}: ",
inspect(result)
Expand Down
4 changes: 2 additions & 2 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ config :indexer, Indexer.Block.Realtime.Supervisor, enabled: System.get_env("DIS
config :indexer, Indexer.Fetcher.TokenInstance.Supervisor,
disabled?: System.get_env("DISABLE_TOKEN_INSTANCE_FETCHER", "false") == "true"

blocks_catchup_fetcher_batch_size_default_str = "10"
blocks_catchup_fetcher_concurrency_default_str = "10"
blocks_catchup_fetcher_batch_size_default_str = "5"
blocks_catchup_fetcher_concurrency_default_str = "5"

{blocks_catchup_fetcher_batch_size, _} =
Integer.parse(System.get_env("INDEXER_CATCHUP_BLOCKS_BATCH_SIZE", blocks_catchup_fetcher_batch_size_default_str))
Expand Down
Loading