Skip to content

Inconsistent behavior when history_receiver.recv() returns None #141

Description

@progval

ServicesServer ignores it:

update = history_receiver.recv() =>
{
if let Some(update) = update
{
if let NetworkStateChange::NewServer(new_server) = &update.change
{
if new_server.server == self.node.id()
{
self.burst_to_network().await;
}
}
}
}

but HistoryServer breaks the loop:

update = history_receiver.recv() =>
{
let Some(update) = update else { break; };
if let Err(error) = self.handle_history_update(update).await {
tracing::error!(?error, "Error return handling history update");
}
}

HistoryServer is probably the correct one here, it looks like ServicesServer would enter an infinite loop when the associated sender is dropped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions