paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.6k stars 948 forks source link

The database read transaction has been open for too long #9359

Open mrdabir opened 3 weeks ago

mrdabir commented 3 weeks ago

Describe the bug

My code was getting blockhead, getTransactionByHash, getBlock and readPastLogs methods. I have subscription on mempool and new block heads

Steps to reproduce

It happens by random

After restarting the node it will be fixed again.

Node logs

execution-1  | 2024-07-07T09:30:13.910284Z  WARN The database read transaction has been open for too long. Backtrace:
execution-1  |    0: <unknown>
execution-1  |    1: <unknown>
execution-1  |    2: <unknown>
execution-1  |    3: <unknown>
execution-1  |    4: <unknown>
execution-1  |    5: <unknown>
execution-1  |    6: <unknown>
execution-1  |    7: <unknown>
execution-1  |    8: <unknown>
execution-1  |    9: <unknown>
execution-1  |   10: <unknown>
execution-1  |   11: <unknown>
execution-1  |   12: <unknown>
execution-1  |   13: __clone
execution-1  |  open_duration=117.342355332s self.txn_id=14134901
execution-1  | 2024-07-07T09:30:16.016115Z  WARN The database read transaction has been open for too long. Backtrace:
execution-1  |    0: <unknown>
execution-1  |    1: <unknown>
execution-1  |    2: <unknown>
execution-1  |    3: <unknown>
execution-1  |    4: <unknown>
execution-1  |    5: <unknown>
execution-1  |    6: <unknown>
execution-1  |    7: <unknown>
execution-1  |    8: <unknown>
execution-1  |    9: <unknown>
execution-1  |   10: <unknown>
execution-1  |   11: <unknown>
execution-1  |   12: <unknown>
execution-1  |   13: <unknown>
execution-1  |   14: <unknown>
execution-1  |   15: __clone
execution-1  |  open_duration=122.098230191s self.txn_id=14134901
execution-1  | 2024-07-07T09:30:16.016550Z  WARN The database read transaction has been open for too long. Backtrace:
execution-1  |    0: <unknown>
execution-1  |    1: <unknown>
execution-1  |    2: <unknown>
execution-1  |    3: <unknown>
execution-1  |    4: <unknown>
execution-1  |    5: <unknown>
execution-1  |    6: <unknown>
execution-1  |    7: <unknown>
execution-1  |    8: <unknown>
execution-1  |    9: <unknown>
execution-1  |   10: <unknown>
execution-1  |   11: <unknown>
execution-1  |   12: __clone
execution-1  |  open_duration=123.469007411s self.txn_id=14134901

Platform(s)

Linux (x86)

What version/commit are you on?

reth Version: 1.0.0 Commit SHA: 83d412d Build Timestamp: 2024-06-24T16:45:09.014806662Z Build Features: jemalloc Build Profile: maxperf

What database version are you on?

2024-07-07T09:45:48.575901Z INFO Initialized tracing, debug log directory: /home/reth/.cache/reth/logs/mainnet Current database version: 2 Local database is uninitialized

Which chain / network are you on?

Ethereum mainnet

What type of node are you running?

Archive (default)

What prune config do you use, if any?

Default

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

gakonst commented 3 weeks ago

Can you share more steps on how to repro? This can happen indeed if you have a read tx open for too long and when doing things yourself client side it's recommended to reopen the TX but it shouldn't happen if you're using json RPC.

emhane commented 2 weeks ago

could this have smthg to do with Local database is uninitialized? @shekhirin