From d3fd731fd3d7b2a2da582794fa19438961203790 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 30 Jul 2020 15:04:07 +0200 Subject: [PATCH 1/3] Initial commit Forked at: 5c34fe49f8fccb1f0e0f983bb7f8cbb8850b574b Parent branch: origin/master From a041b097e28ab54667a20ba5065bfb114b55f298 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 30 Jul 2020 15:06:36 +0200 Subject: [PATCH 2/3] Fix graceful shutdown skipped if future ends with error --- client/cli/src/runner.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/cli/src/runner.rs b/client/cli/src/runner.rs index 219613e6bddee..f25a6d5cd580c 100644 --- a/client/cli/src/runner.rs +++ b/client/cli/src/runner.rs @@ -229,10 +229,9 @@ impl Runner { ) -> Result<()> { self.print_node_infos(); let mut task_manager = initialise(self.config)?; - self.tokio_runtime.block_on(main(task_manager.future().fuse())) - .map_err(|e| e.to_string())?; + let res = self.tokio_runtime.block_on(main(task_manager.future().fuse())); self.tokio_runtime.block_on(task_manager.clean_shutdown()); - Ok(()) + Ok(res.map_err(|e| e.to_string())?) } /// A helper function that runs a command with the configuration of this node From 7b224df26e52b5c1f84b34c49307dfb024fdc042 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 30 Jul 2020 16:05:56 +0200 Subject: [PATCH 3/3] apply suggestion --- client/cli/src/runner.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cli/src/runner.rs b/client/cli/src/runner.rs index f25a6d5cd580c..bdbf55eb8326a 100644 --- a/client/cli/src/runner.rs +++ b/client/cli/src/runner.rs @@ -231,7 +231,7 @@ impl Runner { let mut task_manager = initialise(self.config)?; let res = self.tokio_runtime.block_on(main(task_manager.future().fuse())); self.tokio_runtime.block_on(task_manager.clean_shutdown()); - Ok(res.map_err(|e| e.to_string())?) + res.map_err(|e| e.to_string().into()) } /// A helper function that runs a command with the configuration of this node