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

faraday-async limit iovecs to iovec max #75

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ChrisWills
Copy link

@ChrisWills ChrisWills commented Dec 19, 2021

I discovered that when using faraday-async while trying to serve large files with httpaf, the writev() syscall would fail with EINVAL because iovcnt was greater than IOV_MAX on my system (Linux).

Lwt works just fine without this patch because [Lwt_unix.writev] does this automatically while [Bigstring_unix.writev] which ultimately gets called on the Async side is more naive and defaults to just slamming whatever iovecs array you give it into writev().
I tried calling [Bigstring_unx.writev] with the optional count argument but that didn't seem to work while this patch did.

A better solution might be to patch [Bigstring_unix.writev] to be smarter about this mirroring the Lwt approach.

@ChrisWills
Copy link
Author

The httpaf example code that I used to reproduce and debug this can be found here:
ChrisWills/httpaf@75328b4

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.

1 participant