Skip to content

Commit 712569d

Browse files
feat: warning log when blocked on execution cache (#19222)
1 parent 35b28ea commit 712569d

File tree

1 file changed

+15
-4
lines changed
  • crates/engine/tree/src/tree/payload_processor

1 file changed

+15
-4
lines changed

crates/engine/tree/src/tree/payload_processor/mod.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ use reth_trie_sparse::{
4040
ClearedSparseStateTrie, SparseStateTrie, SparseTrie,
4141
};
4242
use reth_trie_sparse_parallel::{ParallelSparseTrie, ParallelismThresholds};
43-
use std::sync::{
44-
atomic::AtomicBool,
45-
mpsc::{self, channel, Sender},
46-
Arc,
43+
use std::{
44+
sync::{
45+
atomic::AtomicBool,
46+
mpsc::{self, channel, Sender},
47+
Arc,
48+
},
49+
time::Instant,
4750
};
4851
use tracing::{debug, debug_span, instrument, warn};
4952

@@ -596,8 +599,16 @@ impl ExecutionCache {
596599
/// A cache is considered available when:
597600
/// - It exists and matches the requested parent hash
598601
/// - No other tasks are currently using it (checked via Arc reference count)
602+
#[instrument(level = "debug", target = "engine::tree::payload_processor", skip(self))]
599603
pub(crate) fn get_cache_for(&self, parent_hash: B256) -> Option<SavedCache> {
604+
let start = Instant::now();
600605
let cache = self.inner.read();
606+
607+
let elapsed = start.elapsed();
608+
if elapsed.as_millis() > 5 {
609+
warn!(blocked_for=?elapsed, "Blocked waiting for execution cache mutex");
610+
}
611+
601612
cache
602613
.as_ref()
603614
.filter(|c| c.executed_block_hash() == parent_hash && c.is_available())

0 commit comments

Comments
 (0)