Stream: wasi

Topic: TCP no-delay


view this post on Zulip Joel Dice (Dec 06 2023 at 19:02):

@Badeend I'm upgrading my wasi-libc fork to use the latest WASI RC. I see you removed TCP no-delay. What should we do if setsockopt is called with TCP_NODELAY? Just ignore it?

view this post on Zulip Joel Dice (Dec 06 2023 at 19:03):

Or return an error if the value being set is zero?

view this post on Zulip Dave Bakker (badeend) (Dec 06 2023 at 19:03):

Did you see the pr I've posted? I already updated it for you

view this post on Zulip Joel Dice (Dec 06 2023 at 19:04):

oops, no

view this post on Zulip Joel Dice (Dec 06 2023 at 19:05):

ugh, I didn't get an email about it for some reason. Thanks for the PR.

view this post on Zulip Joel Dice (Dec 06 2023 at 19:09):

I think removing support for TCP_NODELAY is going to break one of my test cases. tokio-postgres sets it and will error out and refuse to connect if that fails. Could we accept nonzero values as a no-op and only return an error if someone tries to set it to zero?

view this post on Zulip Joel Dice (Dec 06 2023 at 19:41):

Ah, I didn't get an email because I wasn't "watching" my own fork on GitHub :face_palm: Just fixed that

view this post on Zulip Notification Bot (Dec 06 2023 at 19:41):

A message was moved here from #wasi > Container containing WASI-SDK and wasmtime? by Joel Dice.

view this post on Zulip Dave Bakker (badeend) (Dec 07 2023 at 09:36):

Could we accept nonzero values as a no-op (...) ?

Yes :+1: , but not for the reason you've documented. :joy_cat:

I've created a follow-up PR. Hopefully that clears it up.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
To answer your question: how should TCP_NODELAY be handled? Many applications use it and will choke if it doesn't work. I assume it was removed from wasi-sockets because it's always enabled there?...

view this post on Zulip Joel Dice (Dec 07 2023 at 14:49):

Thanks (as always) for the PR. Out of curiosity: what's the reason this is not yet supported in wasi-sockets? Are there portability concerns?

view this post on Zulip Dave Bakker (badeend) (Dec 07 2023 at 15:39):

Well the TLDR would be: preview2 had to be shipped, and it wasn't clear yet (nor specified) how TCP_NODELAY would affect wasi:io input- and output streams


Last updated: Nov 22 2024 at 16:03 UTC