-
Notifications
You must be signed in to change notification settings - Fork 1.6k
overseer: send_msg should not return an error #1995
Conversation
* master: Improve collator side of the collator-protocol (#1955)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
where T: IntoIterator<Item = AllMessages> + Send, T::IntoIter: Send | ||
{ | ||
let mut msgs = stream::iter(msgs.into_iter().map(ToOverseer::SubsystemMessage).map(Ok)); | ||
self.tx.send_all(&mut msgs).await.map_err(Into::into) | ||
if self.tx.send_all(&mut msgs).await.is_err() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sending can only fail when the overseer has closed the channel. Do we really need to log this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be helpful for debugging purposes when running tests. Normally we should not see it fail when if the overseer sends Conclude
signal in test environment. I can downgrade the log level to debug
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, ty
node/overseer/src/lib.rs
Outdated
} | ||
|
||
impl<M> OverseerSubsystemContext<M> { | ||
async fn send_logging_error(&mut self, msg: ToOverseer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe send_and_log_error
?
|
||
impl<M> OverseerSubsystemContext<M> { | ||
async fn send_logging_error(&mut self, msg: ToOverseer) { | ||
if self.tx.send(msg).await.is_err() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Fixes #1602 (comment).