skip passed slots and wake up service correctly (#4212)

This commit is contained in:
Robert Habermeier
2019-11-26 18:38:03 +01:00
committed by Gavin Wood
parent 5010faa9bd
commit 52b5dee4f9
3 changed files with 33 additions and 10 deletions
+7 -3
View File
@@ -49,7 +49,7 @@ use sr_primitives::traits::{
use substrate_executor::{NativeExecutor, NativeExecutionDispatch};
use std::{
io::{Read, Write, Seek},
marker::PhantomData, sync::Arc, sync::atomic::AtomicBool, time::SystemTime
marker::PhantomData, sync::Arc, time::SystemTime
};
use sysinfo::{get_current_pid, ProcessExt, System, SystemExt};
use tel::{telemetry, SUBSTRATE_INFO};
@@ -823,6 +823,9 @@ ServiceBuilder<
let (to_spawn_tx, to_spawn_rx) =
mpsc::unbounded::<Box<dyn Future<Item = (), Error = ()> + Send>>();
// A side-channel for essential tasks to communicate shutdown.
let (essential_failed_tx, essential_failed_rx) = mpsc::unbounded();
let import_queue = Box::new(import_queue);
let chain_info = client.info().chain;
@@ -1163,7 +1166,7 @@ ServiceBuilder<
let _ = to_spawn_tx.unbounded_send(Box::new(future));
}
// Instrumentation
if let Some(tracing_targets) = config.tracing_targets.as_ref() {
let subscriber = substrate_tracing::ProfilingSubscriber::new(
@@ -1183,7 +1186,8 @@ ServiceBuilder<
transaction_pool,
exit,
signal: Some(signal),
essential_failed: Arc::new(AtomicBool::new(false)),
essential_failed_tx,
essential_failed_rx,
to_spawn_tx,
to_spawn_rx,
to_poll: Vec::new(),