Skip to content

Commit

Permalink
Fix clippy failure on beta channel (MystenLabs/narwhal#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtian authored Aug 22, 2022
1 parent 63a239f commit 4cf926a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion narwhal/executor/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Subscriber {
// Fetch the certificate's payload from the workers. This is done via the
// block_waiter component. If the batches are not available in the workers then
// block_waiter will do its best to sync from the other peers. Once all batches
// are available, we forward the certificate o the Executor Core.
// are available, we forward the certificate to the Executor Core.
let future = Self::wait_on_payload(
self.get_block_retry_policy.clone(),
self.store.clone(),
Expand Down
26 changes: 11 additions & 15 deletions narwhal/primary/src/header_waiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,18 @@ impl HeaderWaiter {
}
}
},

// we poll the availability of a slot to send the result to the core simultaneously
(Some(result), permit) = try_fut_and_permit!(waiting.try_next(), self.tx_core) => match result {
Some(header) => {
let _ = self.pending.remove(&header.id);
for x in header.payload.keys() {
let _ = self.batch_requests.remove(x);
}
for x in &header.parents {
let _ = self.parent_requests.remove(x);
}
permit.send(header);
},
None => {
// This request has been canceled.
},
},
(Some(result), permit) = try_fut_and_permit!(waiting.try_next(), self.tx_core) => if let Some(header) = result {
let _ = self.pending.remove(&header.id);
for x in header.payload.keys() {
let _ = self.batch_requests.remove(x);
}
for x in &header.parents {
let _ = self.parent_requests.remove(x);
}
permit.send(header);
}, // This request has been canceled when result is None.

() = &mut timer => {
// We optimistically sent sync requests to a single node. If this timer triggers,
Expand Down

0 comments on commit 4cf926a

Please sign in to comment.