Relates to: #830
async fn run_udp_server(tracker: Arc<Tracker>, socket: Arc<UdpSocket>) {
let tracker = tracker.clone();
let socket = socket.clone();
let reqs = &mut ActiveRequests::default();
// Main Waiting Loop, awaits on async [`receive_request`].
loop {
if let Some(h) = reqs.rb.push_overwrite(
Self::spawn_request_processor(Self::receive_request(socket.clone()).await, tracker.clone(), socket.clone())
.abort_handle(),
) {
if !h.is_finished() {
// the task is still running, lets yield and give it a chance to flush.
tokio::task::yield_now().await;
h.abort();
let server_socket_addr = socket.local_addr().expect("Could not get local_addr for socket.");
tracing::span!(
target: "UDP TRACKER",
tracing::Level::WARN, "request-aborted", server_socket_addr = %server_socket_addr);
}
}
}
}
We are using the push_overwrite method.

That method overwrites the latest item, not the oldest. Does that make sense in our case? Would not be better if we overwrite the oldest request? That's the one that has had a longer time to be processed.
cc @da2ce7
Relates to: #830
We are using the
push_overwritemethod.That method overwrites the latest item, not the oldest. Does that make sense in our case? Would not be better if we overwrite the oldest request? That's the one that has had a longer time to be processed.
cc @da2ce7