Rename and uniquify QUIC thread names (#28)
When viewing in various tools such as gdb and perf, it is not easy to distinguish which threads are serving which function (TPU or TPU FWD)
This commit is contained in:
parent
f6cd7c278e
commit
4753dcae71
|
@ -260,6 +260,7 @@ mod tests {
|
||||||
thread: response_recv_thread,
|
thread: response_recv_thread,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = solana_streamer::quic::spawn_server(
|
} = solana_streamer::quic::spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
response_recv_socket,
|
response_recv_socket,
|
||||||
&keypair2,
|
&keypair2,
|
||||||
|
|
|
@ -153,6 +153,7 @@ impl Tpu {
|
||||||
thread: tpu_quic_t,
|
thread: tpu_quic_t,
|
||||||
key_updater,
|
key_updater,
|
||||||
} = spawn_server(
|
} = spawn_server(
|
||||||
|
"solQuicTpu",
|
||||||
"quic_streamer_tpu",
|
"quic_streamer_tpu",
|
||||||
transactions_quic_sockets,
|
transactions_quic_sockets,
|
||||||
keypair,
|
keypair,
|
||||||
|
@ -172,6 +173,7 @@ impl Tpu {
|
||||||
thread: tpu_forwards_quic_t,
|
thread: tpu_forwards_quic_t,
|
||||||
key_updater: forwards_key_updater,
|
key_updater: forwards_key_updater,
|
||||||
} = spawn_server(
|
} = spawn_server(
|
||||||
|
"solQuicTpuFwd",
|
||||||
"quic_streamer_tpu_forwards",
|
"quic_streamer_tpu_forwards",
|
||||||
transactions_forwards_quic_sockets,
|
transactions_forwards_quic_sockets,
|
||||||
keypair,
|
keypair,
|
||||||
|
|
|
@ -69,7 +69,7 @@ lazy_static! {
|
||||||
static ref ASYNC_TASK_SEMAPHORE: AsyncTaskSemaphore =
|
static ref ASYNC_TASK_SEMAPHORE: AsyncTaskSemaphore =
|
||||||
AsyncTaskSemaphore::new(MAX_OUTSTANDING_TASK);
|
AsyncTaskSemaphore::new(MAX_OUTSTANDING_TASK);
|
||||||
static ref RUNTIME: Runtime = tokio::runtime::Builder::new_multi_thread()
|
static ref RUNTIME: Runtime = tokio::runtime::Builder::new_multi_thread()
|
||||||
.thread_name("quic-client")
|
.thread_name("solQuicClientRt")
|
||||||
.enable_all()
|
.enable_all()
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -72,6 +72,7 @@ mod tests {
|
||||||
thread: t,
|
thread: t,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = solana_streamer::quic::spawn_server(
|
} = solana_streamer::quic::spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
s.try_clone().unwrap(),
|
s.try_clone().unwrap(),
|
||||||
&keypair,
|
&keypair,
|
||||||
|
@ -212,6 +213,7 @@ mod tests {
|
||||||
thread: request_recv_thread,
|
thread: request_recv_thread,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = solana_streamer::quic::spawn_server(
|
} = solana_streamer::quic::spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
request_recv_socket.try_clone().unwrap(),
|
request_recv_socket.try_clone().unwrap(),
|
||||||
&keypair,
|
&keypair,
|
||||||
|
@ -239,6 +241,7 @@ mod tests {
|
||||||
thread: response_recv_thread,
|
thread: response_recv_thread,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = solana_streamer::quic::spawn_server(
|
} = solana_streamer::quic::spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
response_recv_socket,
|
response_recv_socket,
|
||||||
&keypair2,
|
&keypair2,
|
||||||
|
|
|
@ -100,9 +100,9 @@ pub(crate) fn configure_server(
|
||||||
Ok((server_config, cert_chain_pem))
|
Ok((server_config, cert_chain_pem))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rt() -> Runtime {
|
fn rt(name: String) -> Runtime {
|
||||||
tokio::runtime::Builder::new_multi_thread()
|
tokio::runtime::Builder::new_multi_thread()
|
||||||
.thread_name("quic-server")
|
.thread_name(name)
|
||||||
.enable_all()
|
.enable_all()
|
||||||
.build()
|
.build()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -431,7 +431,8 @@ impl StreamStats {
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn spawn_server(
|
pub fn spawn_server(
|
||||||
name: &'static str,
|
thread_name: &'static str,
|
||||||
|
metrics_name: &'static str,
|
||||||
sock: UdpSocket,
|
sock: UdpSocket,
|
||||||
keypair: &Keypair,
|
keypair: &Keypair,
|
||||||
packet_sender: Sender<PacketBatch>,
|
packet_sender: Sender<PacketBatch>,
|
||||||
|
@ -443,11 +444,11 @@ pub fn spawn_server(
|
||||||
wait_for_chunk_timeout: Duration,
|
wait_for_chunk_timeout: Duration,
|
||||||
coalesce: Duration,
|
coalesce: Duration,
|
||||||
) -> Result<SpawnServerResult, QuicServerError> {
|
) -> Result<SpawnServerResult, QuicServerError> {
|
||||||
let runtime = rt();
|
let runtime = rt(format!("{thread_name}Rt"));
|
||||||
let (endpoint, _stats, task) = {
|
let (endpoint, _stats, task) = {
|
||||||
let _guard = runtime.enter();
|
let _guard = runtime.enter();
|
||||||
crate::nonblocking::quic::spawn_server(
|
crate::nonblocking::quic::spawn_server(
|
||||||
name,
|
metrics_name,
|
||||||
sock,
|
sock,
|
||||||
keypair,
|
keypair,
|
||||||
packet_sender,
|
packet_sender,
|
||||||
|
@ -461,7 +462,7 @@ pub fn spawn_server(
|
||||||
)
|
)
|
||||||
}?;
|
}?;
|
||||||
let handle = thread::Builder::new()
|
let handle = thread::Builder::new()
|
||||||
.name("solQuicServer".into())
|
.name(thread_name.into())
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
if let Err(e) = runtime.block_on(task) {
|
if let Err(e) = runtime.block_on(task) {
|
||||||
warn!("error from runtime.block_on: {:?}", e);
|
warn!("error from runtime.block_on: {:?}", e);
|
||||||
|
@ -505,6 +506,7 @@ mod test {
|
||||||
thread: t,
|
thread: t,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = spawn_server(
|
} = spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
s,
|
s,
|
||||||
&keypair,
|
&keypair,
|
||||||
|
@ -532,7 +534,7 @@ mod test {
|
||||||
fn test_quic_timeout() {
|
fn test_quic_timeout() {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let (t, exit, receiver, server_address) = setup_quic_server();
|
let (t, exit, receiver, server_address) = setup_quic_server();
|
||||||
let runtime = rt();
|
let runtime = rt("solQuicTestRt".to_string());
|
||||||
runtime.block_on(check_timeout(receiver, server_address));
|
runtime.block_on(check_timeout(receiver, server_address));
|
||||||
exit.store(true, Ordering::Relaxed);
|
exit.store(true, Ordering::Relaxed);
|
||||||
t.join().unwrap();
|
t.join().unwrap();
|
||||||
|
@ -543,7 +545,7 @@ mod test {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let (t, exit, _receiver, server_address) = setup_quic_server();
|
let (t, exit, _receiver, server_address) = setup_quic_server();
|
||||||
|
|
||||||
let runtime = rt();
|
let runtime = rt("solQuicTestRt".to_string());
|
||||||
runtime.block_on(check_block_multiple_connections(server_address));
|
runtime.block_on(check_block_multiple_connections(server_address));
|
||||||
exit.store(true, Ordering::Relaxed);
|
exit.store(true, Ordering::Relaxed);
|
||||||
t.join().unwrap();
|
t.join().unwrap();
|
||||||
|
@ -563,6 +565,7 @@ mod test {
|
||||||
thread: t,
|
thread: t,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = spawn_server(
|
} = spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
s,
|
s,
|
||||||
&keypair,
|
&keypair,
|
||||||
|
@ -577,7 +580,7 @@ mod test {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let runtime = rt();
|
let runtime = rt("solQuicTestRt".to_string());
|
||||||
runtime.block_on(check_multiple_streams(receiver, server_address));
|
runtime.block_on(check_multiple_streams(receiver, server_address));
|
||||||
exit.store(true, Ordering::Relaxed);
|
exit.store(true, Ordering::Relaxed);
|
||||||
t.join().unwrap();
|
t.join().unwrap();
|
||||||
|
@ -588,7 +591,7 @@ mod test {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
let (t, exit, receiver, server_address) = setup_quic_server();
|
let (t, exit, receiver, server_address) = setup_quic_server();
|
||||||
|
|
||||||
let runtime = rt();
|
let runtime = rt("solQuicTestRt".to_string());
|
||||||
runtime.block_on(check_multiple_writes(receiver, server_address, None));
|
runtime.block_on(check_multiple_writes(receiver, server_address, None));
|
||||||
exit.store(true, Ordering::Relaxed);
|
exit.store(true, Ordering::Relaxed);
|
||||||
t.join().unwrap();
|
t.join().unwrap();
|
||||||
|
@ -608,6 +611,7 @@ mod test {
|
||||||
thread: t,
|
thread: t,
|
||||||
key_updater: _,
|
key_updater: _,
|
||||||
} = spawn_server(
|
} = spawn_server(
|
||||||
|
"solQuicTest",
|
||||||
"quic_streamer_test",
|
"quic_streamer_test",
|
||||||
s,
|
s,
|
||||||
&keypair,
|
&keypair,
|
||||||
|
@ -622,7 +626,7 @@ mod test {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let runtime = rt();
|
let runtime = rt("solQuicTestRt".to_string());
|
||||||
runtime.block_on(check_unstaked_node_connect_failure(server_address));
|
runtime.block_on(check_unstaked_node_connect_failure(server_address));
|
||||||
exit.store(true, Ordering::Relaxed);
|
exit.store(true, Ordering::Relaxed);
|
||||||
t.join().unwrap();
|
t.join().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue