8000 If indexing fails try again in 10 seconds by nymkappa · Pull Request #1930 · mempool/mempool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

If indexing fails try again in 10 seconds #1930

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

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

nymkappa
Copy link
Member
@nymkappa nymkappa commented Jun 25, 2022

Fixes #1915

Testing

  • Run bitcoin core
  • Make sure you have many blocks to index (at least 1,000 on mainnet, 10,000 on testnet/signet)
  • Run the node backend
  • Wait for the block indexing to start
Jun 25 19:31:40 [49459] DEBUG: Indexing blocks from #2282488 to #0
Jun 25 19:31:41 [49459] INFO: Indexing 9566 blocks from #2022488 to #2012489
Jun 25 19:31:45 [49459] DEBUG: Indexing block #2021608 | ~74.50 blocks/sec | total: 260881/2282489 (11.43%) | elapsed: 6 seconds | left: ~27136 seconds
  • Suspend or stop bitcoin core
  • Wait for the the node backend connection to core to timeout or fail
### If you suspend you'll see this
Jun 25 19:33:25 [49459] ERR: Block indexing failed. Trying again in 10 seconds. Reason: ETIMEDOUT
Jun 25 19:33:27 [49459] DEBUG: updateMempoolInfo: ETIMEDOUT
### If you stop you'll see this (it's faster to test this way)
Jun 25 19:33:25 [49459] ERR: Block indexing failed. Trying again in 10 seconds. Reason: connect ECONNREFUSED 127.0.0.1:8332
Jun 25 19:33:27 [49459] DEBUG: updateMempoolInfo: connect ECONNREFUSED 127.0.0.1:8332
  • Resume bitcoin core
  • Confirm the block indexing restarts by itself
Jun 25 19:34:04 [49459] DEBUG: Indexing blocks from #2282488 to #0
Jun 25 19:34:06 [49459] INFO: Indexing 5611 blocks from #2022488 to #2012489
Jun 25 19:34:10 [49459] DEBUG: Indexing block #2017688 | ~68.67 blocks/sec | total: 264801/2282489 (11.6%) | elapsed: 6 seconds | left: ~29384 seconds

@nymkappa nymkappa requested a review from wiz June 25, 2022 17:40
@cla-bot cla-bot bot added the cla-signed label Jun 25, 2022
@nymkappa nymkappa force-pushed the nymkappa/bugfix/retry-indexing-upon-error branch from 0e0c6ed to 460c3bf Compare June 25, 2022 17:44
@nymkappa nymkappa changed the title If block indexing fails | chain of hash invalid, try again in 10 seconds If indexing fails try again in 10 seconds Jun 25, 2022
@nymkappa nymkappa marked this pull request as draft June 25, 2022 17:47
@nymkappa nymkappa force-pushed the nymkappa/bugfix/retry-indexing-upon-error branch from 460c3bf to 310a96f Compare June 25, 2022 17:50
@nymkappa nymkappa marked this pull request as ready for review June 25, 2022 17:53
@wiz
Copy link
Member
wiz commented Jul 5, 2022

please rebase onto current master

@nymkappa nymkappa force-pushed the nymkappa/bugfix/retry-indexing-upon-error branch from 5274d9d to bbc9df4 Compare July 6, 2022 08:42
Copy link
Member
@wiz wiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ v2.4.1-dev [e94938d5]

Works fine on prod but it would be nice if @knorrium can test this

@knorrium
Copy link
Member
knorrium commented Jul 6, 2022

Tested ACK

Jul  6 11:01:29 [209561] NOTICE: Starting Mempool Server... (e94938d)
Jul  6 11:01:29 [209561] INFO: Restoring mempool and blocks data from disk cache
Jul  6 11:01:29 [209561] INFO: Database connection established.
Jul  6 11:01:29 [209561] NOTICE: MIGRATIONS: Upgrading database schema version number to 22
Jul  6 11:01:29 [209561] NOTICE: MIGRATIONS: OK. Database schema have been migrated from version 21 to 22 (latest version)
Jul  6 11:01:29 [209561] INFO: Starting statistics service
Jul  6 11:01:29 [209561] INFO: Starting currency rates service
Jul  6 11:01:29 [209561] INFO: Currency rates service will be queried over clearnet using https://price.bisq.wiz.biz/getAllMarketPrices
Jul  6 11:01:29 [209561] NOTICE: Mempool Server is running on port 8999
Jul  6 11:01:29 [209561] INFO: Updating latest mining pools from https://raw.githubusercontent.com/mempool/mining-pools/master/pools.json over clearnet
Jul  6 11:01:30 [209561] INFO: 205 blocks since tip. Fast forwarding to the 8 recent blocks
Jul  6 11:01:30 [209561] INFO: Re-indexing skipped blocks and corresponding hashrates data
Jul  6 11:01:44 [209561] INFO: Fetching hourly price history from exchanges and saving missing ones into the database, this may take a while
Jul  6 11:01:53 [209561] INFO: Inserted 32 hourly historical prices into the db
Jul  6 11:01:59 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 10 sec.
Jul  6 11:02:09 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 20 sec.
Jul  6 11:02:29 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 40 sec.
Jul  6 11:03:09 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 60 sec.
Jul  6 11:04:09 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 60 sec.
Jul  6 11:05:09 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 60 sec.
Jul  6 11:06:09 [209561] WARN: runMainLoop error: connect ECONNREFUSED 127.0.0.1:8332. Retrying in 60 sec.
Jul  6 11:07:09 [209561] WARN: Mempool clear protection triggered because transactions.length: 8109 and currentMempoolSize: 26654.
Jul  6 11:07:18 [209561] INFO: Indexing 154 blocks from #743862 to #733863
Jul  6 11:07:25 [209561] NOTICE: Block indexing completed: indexed 154 blocks
Jul  6 11:07:25 [209561] INFO: 11246 blocks hash validated in 17 ms
Jul  6 11:07:25 [209561] NOTICE: Indexed 6 difficulty adjustments
Jul  6 11:07:25 [209561] NOTICE: Daily network hashrate indexing completed: indexed 1 days

@wiz wiz merged commit 92d7519 into master Jul 6, 2022
@wiz wiz deleted the nymkappa/bugfix/retry-indexing-upon-error branch July 6, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexing stops before completion
3 participants
0