liburing icon indicating copy to clipboard operation
liburing copied to clipboard

Pipe offset issues with splice when client TCP connection is interrupted

Open johalun opened this issue 4 years ago • 0 comments

This might be more of a general Linux question and not so uring specific, I'm not sure. I have a sendfile implementation using splice which normally works great. I have a pipe cache with pipes that I reuse for each new sendfile operation.

The issue is when the client abort and I get a partial write from the read side of the pipe to the TCP socket and I later reuse that pipe. I believe the offset is not reset because the following sendfile operation using the same pipe get stuck when it can not fill the pipe's buffer with the data. Since the client no longer exists, I have no interest in trying to re-transmit the remaining data.

For now the workaround is to close those pipes and create new ones. But, is there a way to reset the offset in the pipe buffer, or is this something io_uring should do in case of failure?

Thanks!

johalun avatar Aug 14 '21 00:08 johalun