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

Preopens #47

Open
badeend opened this issue Aug 17, 2023 · 2 comments
Open

Preopens #47

badeend opened this issue Aug 17, 2023 · 2 comments

Comments

@badeend
Copy link
Collaborator

badeend commented Aug 17, 2023

In the last WASI meeting the subject of socket preopens came up, and how to handle them in preview2.

pchickey noted that he has been asking around if they're actually in use anywhere. So far without result.

Me myself I've found exactly one usage so far:
There's unofficial WASI support for .NET. Even though they make use of preopens, it appears they don't actually want to.

Other uses of sockets in Wasm mostly seem based on home-grown solutions. For example Docker has native Wasm support in preview. Networking capabilities are provided through WasmEdge's non-standard socket extensions. They do not make use of preopens. Similar story for Wasmer.

First off: If you make use of preview1 sockets, please let us know!


Second, Dan noted that SystemD's socket activation could be a valid use case for socket preopens.


CC @dicej

@badeend
Copy link
Collaborator Author

badeend commented Aug 17, 2023

My stance so far: Unless people come pouring in with use cases, I don't think its worth the effort of maintaining two different mechanisms of obtaining socket handles (one being individual socket preopens, the other being through the "preopened" network handle).

The systemd usecase can be transparently handled by the host: before making the actual bind syscall it can check if there are any unused preopened sockets bound to that address. If so: swap over to that socket instead.

@dicej
Copy link

dicej commented Aug 17, 2023

Although I was the one who brought it up the the WASI meeting, I have no strong feelings about this nor any applications that use preopened sockets, so I'd be fine with what @badeend proposes above.

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

No branches or pull requests

2 participants