Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Don't indefinitely block on shutting down Tokio #12885

Merged
merged 2 commits into from
Dec 9, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ impl<C: SubstrateCli> Runner<C> {
self.print_node_infos();
let mut task_manager = self.tokio_runtime.block_on(initialize(self.config))?;
let res = self.tokio_runtime.block_on(main(task_manager.future().fuse()));
Ok(res?)

// Give all futures 60 seconds to shutdown, before tokio "leaks" them.
self.tokio_runtime.shutdown_timeout(Duration::from_secs(60));
ordian marked this conversation as resolved.
Show resolved Hide resolved

res
ordian marked this conversation as resolved.
Show resolved Hide resolved
}

/// A helper function that runs a command with the configuration of this node.
Expand Down