mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(exex): limit the duration of a backfill job to 30 seconds (#11450)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use crate::BackfillJob;
|
||||
use std::ops::RangeInclusive;
|
||||
use std::{ops::RangeInclusive, time::Duration};
|
||||
|
||||
use alloy_primitives::BlockNumber;
|
||||
use reth_node_api::FullNodeComponents;
|
||||
@ -25,7 +25,15 @@ impl<E, P> BackfillJobFactory<E, P> {
|
||||
executor,
|
||||
provider,
|
||||
prune_modes: PruneModes::none(),
|
||||
thresholds: ExecutionStageThresholds::default(),
|
||||
thresholds: ExecutionStageThresholds {
|
||||
// Default duration for a database transaction to be considered long-lived is
|
||||
// 60 seconds, so we limit the backfill job to the half of it to be sure we finish
|
||||
// before the warning is logged.
|
||||
//
|
||||
// See `reth_db::implementation::mdbx::tx::LONG_TRANSACTION_DURATION`.
|
||||
max_duration: Some(Duration::from_secs(30)),
|
||||
..Default::default()
|
||||
},
|
||||
stream_parallelism: DEFAULT_PARALLELISM,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user