diff --git a/Cargo.toml b/Cargo.toml index 8ad17dd72..0c99baa74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ levenshtein_automata = {version="0.1", features=["fst_automaton"]} bit-set = "0.5" uuid = { version = "0.7", features = ["v4", "serde"] } crossbeam = "0.5" -crossbeam-channel = "0.2" +crossbeam-channel = "0.3" futures = "0.1" futures-cpupool = "0.1" owning_ref = "0.4" diff --git a/src/indexer/index_writer.rs b/src/indexer/index_writer.rs index 66de84c16..a67e18802 100644 --- a/src/indexer/index_writer.rs +++ b/src/indexer/index_writer.rs @@ -392,7 +392,7 @@ impl IndexWriter { self.worker_id, generation )).spawn(move || { loop { - let mut document_iterator = document_receiver_clone.clone().peekable(); + let mut document_iterator = document_receiver_clone.clone().into_iter().peekable(); // the peeking here is to avoid // creating a new segment's files @@ -640,7 +640,10 @@ impl IndexWriter { pub fn add_document(&mut self, document: Document) -> u64 { let opstamp = self.stamper.stamp(); let add_operation = AddOperation { opstamp, document }; - self.document_sender.send(add_operation); + let send_result = self.document_sender.send(add_operation); + if let Err(e) = send_result { + panic!("Failed to index document. Sending to indexing channel failed. This probably means all of the indexing threads have panicked. {:?}", e); + } opstamp } }