From 7b9752f897da251cc939aa2599209ec95fbaa6af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 16 Nov 2018 14:26:59 +0900 Subject: [PATCH] Update crossbeam-channel requirement from 0.2 to 0.3 (#436) * Update crossbeam-channel requirement from 0.2 to 0.3 Updates the requirements on [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam-channel) to permit the latest version. - [Release notes](https://github.com/crossbeam-rs/crossbeam-channel/releases) - [Changelog](https://github.com/crossbeam-rs/crossbeam-channel/blob/master/CHANGELOG.md) - [Commits](https://github.com/crossbeam-rs/crossbeam-channel/commits/v0.3.0) Signed-off-by: dependabot[bot] * fixing build --- Cargo.toml | 2 +- src/indexer/index_writer.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 } }