Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spipe stays on read() when remote spiped is terminated #329

Open
gperciva opened this issue Dec 2, 2021 · 0 comments
Open

spipe stays on read() when remote spiped is terminated #329

gperciva opened this issue Dec 2, 2021 · 0 comments

Comments

@gperciva
Copy link
Member

gperciva commented Dec 2, 2021

Was #328, but that patch wasn't successful.

About the connection, @cperciva wrote:

we want the same behaviour as regular (not proxied via spiped) TCP connections -- each direction is shut down independently, so that you can e.g. printf(1) an HTTP request and pipe that into spipe, even though the HTTP response will arrive back long after printf exits (and thus spipe's stdin is EOFed).

Whether we're doing this correctly is an open question, of course. But that's the idea -- an error can shut down the connection in both directions, but EOF only shuts down the connection in one direction.

In this particular case, @cperciva wrote:

Hmm... looking back at the test case, I think it will depend on how the OS handles TCP sockets owned by a process which is being terminated. If it sends a RST then spipe should get a read error and exit; if it sends a FIN then spipe will continue until it tries to send something (at which point it will receive a RST and exit).

IIRC this depends on the SO_LINGER setting and possibly on whether there's any data buffered when the socket is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant