Skip to content

Commit

Permalink
feat: log aborted UDP requests
Browse files Browse the repository at this point in the history
This will add a warning to the lofs when a UDP request is aborted.
  • Loading branch information
josecelano committed May 7, 2024
1 parent 5348669 commit e3143f7
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.");

Check warning on line 297 in src/servers/udp/server.rs

View check run for this annotation

Codecov / codecov/patch

src/servers/udp/server.rs#L297

Added line #L297 was not covered by tests

tracing::span!(

Check warning on line 299 in src/servers/udp/server.rs

View check run for this annotation

Codecov / codecov/patch

src/servers/udp/server.rs#L299

Added line #L299 was not covered by tests
target: "UDP TRACKER",
tracing::Level::WARN, "request-aborted", server_socket_addr = %server_socket_addr);
}
}
}
Expand Down

0 comments on commit e3143f7

Please sign in to comment.