Unverified Commit 3445eeba authored by Robert Klotzner's avatar Robert Klotzner Committed by GitHub
Browse files

Fix busy loops. (#3392)

parent 16f646dc
Pipeline #145018 passed with stages
in 31 minutes and 58 seconds
...@@ -806,8 +806,8 @@ impl AvailabilityRecoverySubsystem { ...@@ -806,8 +806,8 @@ impl AvailabilityRecoverySubsystem {
} }
} }
} }
output = state.interactions.next() => { output = state.interactions.select_next_some() => {
if let Some((candidate_hash, result)) = output.flatten() { if let Some((candidate_hash, result)) = output {
state.availability_lru.put(candidate_hash, result); state.availability_lru.put(candidate_hash, result);
} }
} }
......
...@@ -1138,12 +1138,10 @@ pub(crate) async fn run<Context>( ...@@ -1138,12 +1138,10 @@ pub(crate) async fn run<Context>(
_ = next_inactivity_stream.next() => { _ = next_inactivity_stream.next() => {
disconnect_inactive_peers(&mut ctx, &eviction_policy, &state.peer_data).await; disconnect_inactive_peers(&mut ctx, &eviction_policy, &state.peer_data).await;
} }
res = state.collation_fetches.next() => { res = state.collation_fetches.select_next_some() => {
if let Some(res) = res {
handle_collation_fetched_result(&mut ctx, &mut state, res).await; handle_collation_fetched_result(&mut ctx, &mut state, res).await;
} }
} }
}
let mut retained_requested = HashSet::new(); let mut retained_requested = HashSet::new();
for (pending_collation, per_req) in state.requested_collations.iter_mut() { for (pending_collation, per_req) in state.requested_collations.iter_mut() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment