Skip to content

Commit 690d1d2

Browse files
committed
Merge torrust#841: feat: log aborted UDP requests
e3143f7 feat: log aborted UDP requests (Jose Celano) Pull request description: This will add a warning to the logs when a UDP request is aborted. ACKs for top commit: josecelano: ACK e3143f7 Tree-SHA512: db44e3358e3ac45d36c0f88c420bfdd3b0412d2ee4a4c7d564a47aba5398979b4d1765836ae740855943e4559c1f68520d8c5256690839c864559f4ef3d46a37
2 parents 5348669 + e3143f7 commit 690d1d2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/servers/udp/server.rs

+7
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,14 @@ impl Udp {
291291
if !h.is_finished() {
292292
// the task is still running, lets yield and give it a chance to flush.
293293
tokio::task::yield_now().await;
294+
294295
h.abort();
296+
297+
let server_socket_addr = socket.local_addr().expect("Could not get local_addr for socket.");
298+
299+
tracing::span!(
300+
target: "UDP TRACKER",
301+
tracing::Level::WARN, "request-aborted", server_socket_addr = %server_socket_addr);
295302
}
296303
}
297304
}

0 commit comments

Comments
 (0)