mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-26 03:59:58 +00:00
Adding panic handler for the rayon merge thread pool
This commit is contained in:
@@ -287,6 +287,17 @@ impl SegmentUpdater {
|
|||||||
let merge_thread_pool = ThreadPoolBuilder::new()
|
let merge_thread_pool = ThreadPoolBuilder::new()
|
||||||
.thread_name(|i| format!("merge_thread_{i}"))
|
.thread_name(|i| format!("merge_thread_{i}"))
|
||||||
.num_threads(num_merge_threads)
|
.num_threads(num_merge_threads)
|
||||||
|
.panic_handler(move |panic| {
|
||||||
|
let message = if let Some(msg) = panic.downcast_ref::<&str>() {
|
||||||
|
*msg
|
||||||
|
} else if let Some(msg) = panic.downcast_ref::<String>() {
|
||||||
|
msg.as_str()
|
||||||
|
} else {
|
||||||
|
"UNKNOWN"
|
||||||
|
};
|
||||||
|
eprintln!("merge thread panicked with: {message}")
|
||||||
|
|
||||||
|
})
|
||||||
.build()
|
.build()
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
crate::TantivyError::SystemError(
|
crate::TantivyError::SystemError(
|
||||||
|
|||||||
Reference in New Issue
Block a user