From 94b260fd25e3031a9ae1b92be48bf9afa983bebd Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Thu, 21 Nov 2024 12:11:56 +0100 Subject: [PATCH] Remove orphan span --- crates/milli/src/update/new/indexer/mod.rs | 3 --- crates/tracing-trace/src/processor/span_stats.rs | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/milli/src/update/new/indexer/mod.rs b/crates/milli/src/update/new/indexer/mod.rs index bc771e5cd..3960f22ef 100644 --- a/crates/milli/src/update/new/indexer/mod.rs +++ b/crates/milli/src/update/new/indexer/mod.rs @@ -521,9 +521,6 @@ fn compute_word_fst(index: &Index, wtxn: &mut RwTxn) -> Result().put(wtxn, WORDS_FST_KEY, &word_fst_mmap)?; if let Some(PrefixData { prefixes_fst_mmap, prefix_delta }) = prefix_data { diff --git a/crates/tracing-trace/src/processor/span_stats.rs b/crates/tracing-trace/src/processor/span_stats.rs index 584fe53f8..89b5b4997 100644 --- a/crates/tracing-trace/src/processor/span_stats.rs +++ b/crates/tracing-trace/src/processor/span_stats.rs @@ -113,7 +113,10 @@ pub fn to_call_stats( let span = *span; if let Some(parent_id) = span.parent_id { - let (_, _, parent_self_time) = spans.get_mut(&parent_id).unwrap(); + let Some((_, _, parent_self_time)) = spans.get_mut(&parent_id) else { + let (c, _) = calls.get_mut(&span.call_id).unwrap(); + panic!("parent span not found for span: module_path: {:?}, name: {:?}, target: {:?}", c.module_path.as_deref().unwrap_or_default(), c.name, c.target); + }; parent_self_time.add_child_range(self_range.clone()) } total_self_time.add_child_range(self_range);