Skip to content

Commit 0d9a39a

Browse files
committed
print debug information when a key goes missing in bulk read
this helps debug problems down the road
1 parent d74673a commit 0d9a39a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

services/pddb/src/main.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1515,11 +1515,24 @@ fn wrapped_main() -> ! {
15151515
pddb_os.perf_entry(FILE_ID_SERVICES_PDDB_SRC_MAIN, perflib::PERFMETA_STARTBLOCK, 6, std::line!());
15161516
let ser_result: SerializeResult =
15171517
if let Some(key_name) = state.key_list.pop() {
1518-
let attr = basis_cache.key_attributes(&mut pddb_os,
1518+
let attr = match basis_cache.key_attributes(&mut pddb_os,
15191519
&state.dict,
15201520
&key_name,
15211521
if state.is_basis_specified{Some(&state.basis)} else {None}
1522-
).expect("Key went missing during bulk read"); // could be a concurrent process mutating. We don't handle this; flag with a panic.
1522+
) {
1523+
Ok(attr) => attr,
1524+
Err(e) => {
1525+
modals.show_notification(
1526+
&format!("Error: key not found during bulk read:\n{:?}\n{:?}:{}:{}",
1527+
e,
1528+
if state.is_basis_specified{Some(&state.basis)} else {None},
1529+
&state.dict,
1530+
&key_name,
1531+
),
1532+
None).ok();
1533+
continue;
1534+
}
1535+
};
15231536
if attr.len < state.read_limit - state.read_total {
15241537
let mut d = vec![0u8; attr.len];
15251538
match basis_cache.key_read(

0 commit comments

Comments
 (0)