diff --git a/db/src/tx_observer.rs b/db/src/tx_observer.rs index 1b041e96..565a0736 100644 --- a/db/src/tx_observer.rs +++ b/db/src/tx_observer.rs @@ -132,6 +132,11 @@ impl TxObservationService { } pub fn in_progress_did_commit(&mut self, txes: IndexMap) { + // Don't spawn a thread only to say nothing. + if !self.has_observers() { + return; + } + let executor = self.executor.get_or_insert_with(|| { let (tx, rx): (Sender>, Receiver>) = channel(); let mut worker = CommandExecutor::new(rx); @@ -195,7 +200,10 @@ impl CommandExecutor { loop { match self.receiver.recv() { Err(RecvError) => { - eprintln!("Disconnected, terminating CommandExecutor"); + // "The recv operation can only fail if the sending half of a channel (or + // sync_channel) is disconnected, implying that no further messages will ever be + // received." + // No need to log here. return },