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

Make splice atomic #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

badeend
Copy link
Contributor

@badeend badeend commented Feb 14, 2024

Partly a PR, partly a question: what is supposed to happen with the already read data in case the write within splice fails?

Currently, wasmtime throws the data away.

Can we make it such that the splice implementation first reads into a per-stream stash and only then attempt to write it into the destination output stream? Future reads then first check if there is any data in its local stash, before calling the backing implementation.

I think this is in line with Linux' splice and sendfile

@pchickey
Copy link

Yes, we should follow the lead of splice(2) and not throw away read bytes if a write fails. I was lazy about doing that correctly in wasmtime's implementation, but the behavior as it exists today is not desirable.

@guybedford what is the jco behavior for splice?

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

Successfully merging this pull request may close these issues.

None yet

2 participants