Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solana-labs/solana
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7bf33d416a4e6d30489c6e02a391a56c7f83b13a
Choose a base ref
..
head repository: solana-labs/solana
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c67c658439a107cb6a292d840142f38a7982520f
Choose a head ref
Showing with 19 additions and 14 deletions.
  1. +19 −14 streamer/src/quic.rs
33 changes: 19 additions & 14 deletions streamer/src/quic.rs
Original file line number Diff line number Diff line change
@@ -539,20 +539,25 @@ pub fn spawn_server(

let remote_addr = connection.remote_address();

let (mut connection_table_l, stake) = if let Some(stake) =
staked_nodes.read().unwrap().get(&remote_addr.ip())
{
let mut connection_table_l = staked_connection_table.lock().unwrap();
let num_pruned =
connection_table_l.prune_oldest(max_staked_connections);
stats.num_evictions.fetch_add(num_pruned, Ordering::Relaxed);
(connection_table_l, *stake)
} else {
let mut connection_table_l = connection_table.lock().unwrap();
let num_pruned =
connection_table_l.prune_oldest(max_unstaked_connections);
stats.num_evictions.fetch_add(num_pruned, Ordering::Relaxed);
(connection_table_l, 0)
let (mut connection_table_l, stake) = {
let staked_nodes = staked_nodes.read().unwrap();
if let Some(stake) = staked_nodes.get(&remote_addr.ip()) {
let stake = *stake;
drop(staked_nodes);
let mut connection_table_l =
staked_connection_table.lock().unwrap();
let num_pruned =
connection_table_l.prune_oldest(max_staked_connections);
stats.num_evictions.fetch_add(num_pruned, Ordering::Relaxed);
(connection_table_l, stake)
} else {
drop(staked_nodes);
let mut connection_table_l = connection_table.lock().unwrap();
let num_pruned =
connection_table_l.prune_oldest(max_unstaked_connections);
stats.num_evictions.fetch_add(num_pruned, Ordering::Relaxed);
(connection_table_l, 0)
}
};

if let Some((last_update, stream_exit)) = connection_table_l