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

Commit

Permalink
overseer: send_msg should not return an error (#1995)
Browse files Browse the repository at this point in the history
* send_message should not return an error

* Apply suggestions from code review

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* s/send_logging_error/send_and_log_error

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
  • Loading branch information
ordian and coriolinus authored Nov 23, 2020
1 parent 7ac0353 commit ffedeab
Show file tree
Hide file tree
Showing 21 changed files with 330 additions and 462 deletions.
5 changes: 1 addition & 4 deletions node/collation-generation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ impl CollationGenerationSubsystem {
},
msg = receiver.next().fuse() => {
if let Some(msg) = msg {
if let Err(err) = ctx.send_message(msg).await {
tracing::warn!(target: LOG_TARGET, err = ?err, "failed to forward message to overseer");
break;
}
ctx.send_message(msg).await;
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions node/core/av-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ where
RuntimeApiRequest::CandidateEvents(tx),
));

ctx.send_message(msg.into()).await?;
ctx.send_message(msg.into()).await;

Ok(rx.await??)
}
Expand Down Expand Up @@ -858,7 +858,7 @@ where
{
let (tx, rx) = oneshot::channel();

ctx.send_message(AllMessages::ChainApi(ChainApiMessage::BlockNumber(block_hash, tx))).await?;
ctx.send_message(AllMessages::ChainApi(ChainApiMessage::BlockNumber(block_hash, tx))).await;

Ok(rx.await??.map(|number| number).unwrap_or_default())
}
Expand Down
2 changes: 1 addition & 1 deletion node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async fn runtime_api_request<T>(
relay_parent,
request,
))
).await?;
).await;

receiver.await.map_err(Into::into)
}
Expand Down
4 changes: 2 additions & 2 deletions node/core/proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ where

let (sender, receiver) = futures::channel::oneshot::channel();

overseer.wait_for_activation(parent_header_hash, sender).await?;
overseer.wait_for_activation(parent_header_hash, sender).await;
receiver.await.map_err(|_| Error::ClosedChannelAwaitingActivation)??;

let (sender, receiver) = futures::channel::oneshot::channel();
overseer.send_msg(AllMessages::Provisioner(
ProvisionerMessage::RequestInherentData(parent_header_hash, sender),
)).await?;
)).await;

let mut timeout = futures_timer::Delay::new(PROPOSE_TIMEOUT).fuse();

Expand Down
Loading

0 comments on commit ffedeab

Please sign in to comment.