Skip to content

Commit

Permalink
Merge torrust#841: feat: log aborted UDP requests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
josecelano committed May 7, 2024
2 parents 5348669 + e3143f7 commit 690d1d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/servers/udp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,14 @@ impl Udp {
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);
}
}
}
Expand Down

0 comments on commit 690d1d2

Please sign in to comment.