Improve tokio task execution (#1181)
* Add logging on shutdown * Replace tokio::spawn with handle.spawn * Upgrade tokio * Add a task executor * Beacon chain tasks use task executor * Validator client tasks use task executor * Rename runtime_handle to executor * Add duration histograms; minor fixes * Cleanup * Fix logs * Fix tests * Remove random file * Get enr dependency instead of libp2p * Address some review comments * Libp2p takes a TaskExecutor * Ugly fix libp2p tests * Move TaskExecutor to own file * Upgrade Dockerfile rust version * Minor fixes * Revert "Ugly fix libp2p tests" This reverts commit 58d4bb690f52de28d893943b7504d2d0c6621429. * Pretty fix libp2p tests * Add spawn_without_exit; change Counter to Gauge * Tidy * Move log from RuntimeContext to TaskExecutor * Fix errors * Replace histogram with int_gauge for async tasks * Fix todo * Fix memory leak in test by exiting all spawned tasks at the end
This commit is contained in:
@@ -58,7 +58,7 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
|
||||
&matches,
|
||||
&context.eth2_config.spec_constants,
|
||||
&context.eth2_config().spec,
|
||||
context.log.clone(),
|
||||
context.log().clone(),
|
||||
)?;
|
||||
Self::new(context, client_config).await
|
||||
}
|
||||
@@ -75,7 +75,7 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
|
||||
let client_config_1 = client_config.clone();
|
||||
let client_genesis = client_config.genesis.clone();
|
||||
let store_config = client_config.store.clone();
|
||||
let log = context.log.clone();
|
||||
let log = context.log().clone();
|
||||
|
||||
let db_path = client_config.create_db_path()?;
|
||||
let freezer_db_path_res = client_config.create_freezer_db_path();
|
||||
|
||||
Reference in New Issue
Block a user