Set fetch stage socket non blocking to false while during recv (#2542)
* Set fetch stage socket non blocking to false while during recv * remove ProgramError changes from this PR
This commit is contained in:
parent
9abc500269
commit
a9b083e585
|
@ -654,7 +654,8 @@ impl Bank {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
pub fn par_execute_entries(&self, entries: &[(&Entry, Vec<Result<()>>)]) -> Result<()> {
|
|
||||||
|
fn par_execute_entries(&self, entries: &[(&Entry, Vec<Result<()>>)]) -> Result<()> {
|
||||||
inc_new_counter_info!("bank-par_execute_entries-count", entries.len());
|
inc_new_counter_info!("bank-par_execute_entries-count", entries.len());
|
||||||
let results: Vec<Result<()>> = entries
|
let results: Vec<Result<()>> = entries
|
||||||
.into_par_iter()
|
.into_par_iter()
|
||||||
|
|
|
@ -19,7 +19,7 @@ impl FetchStage {
|
||||||
let tx_sockets = sockets.into_iter().map(Arc::new).collect();
|
let tx_sockets = sockets.into_iter().map(Arc::new).collect();
|
||||||
Self::new_multi_socket(tx_sockets, exit)
|
Self::new_multi_socket(tx_sockets, exit)
|
||||||
}
|
}
|
||||||
pub fn new_multi_socket(
|
fn new_multi_socket(
|
||||||
sockets: Vec<Arc<UdpSocket>>,
|
sockets: Vec<Arc<UdpSocket>>,
|
||||||
exit: Arc<AtomicBool>,
|
exit: Arc<AtomicBool>,
|
||||||
) -> (Self, PacketReceiver) {
|
) -> (Self, PacketReceiver) {
|
||||||
|
|
|
@ -182,7 +182,6 @@ impl Packets {
|
||||||
Err(_) if i > 0 => {
|
Err(_) if i > 0 => {
|
||||||
inc_new_counter_info!("packets-recv_count", i);
|
inc_new_counter_info!("packets-recv_count", i);
|
||||||
debug!("got {:?} messages on {}", i, socket.local_addr().unwrap());
|
debug!("got {:?} messages on {}", i, socket.local_addr().unwrap());
|
||||||
socket.set_nonblocking(true)?;
|
|
||||||
return Ok(i);
|
return Ok(i);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
@ -190,10 +189,12 @@ impl Packets {
|
||||||
return Err(Error::IO(e));
|
return Err(Error::IO(e));
|
||||||
}
|
}
|
||||||
Ok(npkts) => {
|
Ok(npkts) => {
|
||||||
|
if i == 0 {
|
||||||
|
socket.set_nonblocking(true)?;
|
||||||
|
}
|
||||||
trace!("got {} packets", npkts);
|
trace!("got {} packets", npkts);
|
||||||
i += npkts;
|
i += npkts;
|
||||||
if npkts != NUM_RCVMMSGS {
|
if npkts != NUM_RCVMMSGS || i >= 1024 {
|
||||||
socket.set_nonblocking(true)?;
|
|
||||||
inc_new_counter_info!("packets-recv_count", i);
|
inc_new_counter_info!("packets-recv_count", i);
|
||||||
return Ok(i);
|
return Ok(i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue