From d4acb29ca51f6e4a82650945423ed0d5084bdb5f Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Mon, 18 Dec 2023 22:52:35 +0900 Subject: [PATCH] Polish ::schedule_execution() a bit --- unified-scheduler-pool/src/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/unified-scheduler-pool/src/lib.rs b/unified-scheduler-pool/src/lib.rs index 21db10bdef0033..b3289f7537a8e2 100644 --- a/unified-scheduler-pool/src/lib.rs +++ b/unified-scheduler-pool/src/lib.rs @@ -268,20 +268,22 @@ impl InstalledScheduler for PooledScheduler { fn schedule_execution(&self, &(transaction, index): &(&SanitizedTransaction, usize)) { let (result, timings) = &mut *self.result_with_timings.lock().expect("not poisoned"); + if result.is_err() { + // just bail out early to short-circuit the processing altogether + return; + } // ... so, we're NOT scheduling at all here; rather, just execute tx straight off. the // inter-tx locking deps aren't needed to be resolved in the case of single-threaded FIFO // like this. - if result.is_ok() { - TH::handle( - result, - timings, - self.context().bank(), - transaction, - index, - &self.inner.pool.handler_context, - ); - } + TH::handle( + result, + timings, + self.context().bank(), + transaction, + index, + &self.inner.pool.handler_context, + ); } fn wait_for_termination(