Fix import queue thread pool shutdown (#4929)

* Fix import queue thread pool shutdown

* Make sure runtime is disposed before telemetry

* Close channel istead of sending a message

* Fixed test
This commit is contained in:
Arkadiy Paronyan
2020-02-17 10:49:40 +01:00
committed by GitHub
parent c7b09b642a
commit c8fa6518bf
5 changed files with 78 additions and 14 deletions
+2
View File
@@ -128,12 +128,14 @@ where
// we eagerly drop the service so that the internal exit future is fired,
// but we need to keep holding a reference to the global telemetry guard
// and drop the runtime first.
let _telemetry = service.telemetry();
let f = service.fuse();
pin_mut!(f);
runtime.block_on(main(f)).map_err(|e| e.to_string())?;
drop(runtime);
Ok(())
}