fix memory leak

This commit is contained in:
sijie.sun
2025-03-05 17:53:19 +08:00
committed by Sijie.Sun
parent 673c34cf5a
commit 568dca6f9c
5 changed files with 45 additions and 31 deletions
+7 -2
View File
@@ -84,9 +84,7 @@ impl PingIntervalController {
self.throughput.rx_packets() > self.last_throughput.rx_packets()
}
#[tracing::instrument]
fn should_send_ping(&mut self) -> bool {
tracing::trace!(?self, "check should_send_ping");
if self.loss_counter.load(Ordering::Relaxed) > 0 {
self.backoff_idx = 0;
} else if self.tx_increase() && !self.rx_increase() {
@@ -253,6 +251,13 @@ impl PeerConnPinger {
continue;
}
tracing::debug!(
"pingpong controller send pingpong task, seq: {}, node_id: {}, controller: {:?}",
req_seq,
my_node_id,
controller
);
let mut sink = sink.clone();
let receiver = ctrl_resp_sender.subscribe();
let ping_res_sender = ping_res_sender.clone();