Skip to content

Commit c5ab64b

Browse files
committed
io_uring: write call also with timeout
1 parent cddc783 commit c5ab64b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/io_uring.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ async fn copy<A: Endpoint<A>, B: Endpoint<B>>(
8787
// returns an owned slice of our `Vec<u8>`, which we later turn back
8888
// into the full `Vec<u8>`
8989
debug!("{}: before write", dbg_name);
90-
let (res, buf_write) = to.write(buf_read.slice(..n)).submit().await;
90+
let retval = to.write(buf_read.slice(..n)).submit();
91+
let (res, buf_write) = timeout(READ_TIMEOUT, retval).await?;
9192
let n = res?;
9293
debug!("{}: after write, {} bytes", dbg_name, n);
9394
// Increment byte counters for statistics

0 commit comments

Comments
 (0)