From 90aa00a434c2a617ec0a8ae98bbcf87374614f18 Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Mon, 19 Feb 2024 16:18:52 -0800 Subject: [PATCH] Name the diskbuffer thread (#540) Co-authored-by: Dan Laine --- firewood/src/db.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/firewood/src/db.rs b/firewood/src/db.rs index b278b564a..88e2a8b32 100644 --- a/firewood/src/db.rs +++ b/firewood/src/db.rs @@ -520,12 +520,14 @@ impl Db { let disk_requester = DiskBufferRequester::new(sender); let buffer = cfg.buffer.clone(); #[allow(clippy::unwrap_used)] - let disk_thread = block_in_place(|| { - Some(std::thread::spawn(move || { - let disk_buffer = DiskBuffer::new(inbound, &buffer, &wal).unwrap(); - disk_buffer.run() - })) - }); + let disk_buffer = DiskBuffer::new(inbound, &buffer, &wal).expect("DiskBuffer::new"); + + let disk_thread = Some( + std::thread::Builder::new() + .name("DiskBuffer".to_string()) + .spawn(move || disk_buffer.run()) + .expect("thread spawn should succeed"), + ); #[allow(clippy::unwrap_used)] let root_hash_cache: Arc = CachedSpace::new(