node: fix shutdown (#1308)

* node: remove grandpa authority flags

* node: exit-guard grandpa and aura spawned futures

* node: wait for futures to stop running on shutdown

* core: run connectivity tests on same ports

* core: pass on_exit future when starting aura and grandpa

* node: add issue number to todo

* core: fix aura and grandpa tests
This commit is contained in:
André Silva
2018-12-21 16:30:45 +00:00
committed by Robert Habermeier
parent ef8b94656e
commit f8f932d123
7 changed files with 54 additions and 28 deletions
+7 -3
View File
@@ -107,7 +107,7 @@ pub struct Service<Components: components::Components> {
/// Configuration of this Service
pub config: FactoryFullConfiguration<Components::Factory>,
_rpc: Box<::std::any::Any + Send + Sync>,
_telemetry: Option<tel::Telemetry>,
_telemetry: Option<Arc<tel::Telemetry>>,
}
/// Creates bare client without any networking.
@@ -263,7 +263,7 @@ impl<Components: components::Components> Service<Components> {
let impl_name = config.impl_name.to_owned();
let version = version.clone();
let chain_name = config.chain_spec.name().to_owned();
Some(tel::init_telemetry(tel::TelemetryConfig {
Some(Arc::new(tel::init_telemetry(tel::TelemetryConfig {
url: url,
on_connect: Box::new(move || {
telemetry!("system.connected";
@@ -276,7 +276,7 @@ impl<Components: components::Components> Service<Components> {
"authority" => is_authority
);
}),
}))
})))
},
None => None,
};
@@ -306,6 +306,10 @@ impl<Components: components::Components> Service<Components> {
None
}
}
pub fn telemetry(&self) -> Option<Arc<tel::Telemetry>> {
self._telemetry.as_ref().map(|t| t.clone())
}
}
impl<Components> Service<Components> where Components: components::Components {