zebrad: add diagnostics on cancelled download tasks

This commit is contained in:
Henry de Valence 2020-11-12 14:39:03 -08:00
parent ec411574ee
commit b632a24436
1 changed files with 2 additions and 0 deletions

View File

@ -140,6 +140,7 @@ where
async move { async move {
let rsp = tokio::select! { let rsp = tokio::select! {
_ = &mut cancel_rx => { _ = &mut cancel_rx => {
tracing::trace!("task cancelled prior to download completion");
metrics::counter!("sync.cancelled.download.count", 1); metrics::counter!("sync.cancelled.download.count", 1);
return Err("canceled block_fetch_verify".into()) return Err("canceled block_fetch_verify".into())
} }
@ -159,6 +160,7 @@ where
let rsp = verifier.ready_and().await?.call(block); let rsp = verifier.ready_and().await?.call(block);
let verification = tokio::select! { let verification = tokio::select! {
_ = &mut cancel_rx => { _ = &mut cancel_rx => {
tracing::trace!("task cancelled prior to verification");
metrics::counter!("sync.cancelled.verify.count", 1); metrics::counter!("sync.cancelled.verify.count", 1);
return Err("canceled block_fetch_verify".into()) return Err("canceled block_fetch_verify".into())
} }