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

Write FD not non-blocking in async echo server #56

Open
paurkedal opened this issue Jun 21, 2018 · 2 comments
Open

Write FD not non-blocking in async echo server #56

paurkedal opened this issue Jun 21, 2018 · 2 comments
Labels

Comments

@paurkedal
Copy link

Posting a large file though examples/async_echo_post.ml from the current master gives me the following error:

eof                    
2018-06-21 09:09:51.020525+02:00 Error (monitor.ml.Error
  (Unix.Unix_error "Invalid argument" writev_assume_fd_is_nonblocking "")
  ("Raised at file \"src/import0.ml\" (inlined), line 351, characters 22-32"
    "Called from file \"src/result.ml\" (inlined), line 168, characters 17-26"
    "Called from file \"src/raw_fd.ml\", line 272, characters 4-60"
    "Called from file \"src/raw_fd.ml\", line 265, characters 10-26"
    "Re-raised at file \"async/faraday_async.ml\", line 52, characters 6-15"
    "Called from file \"async/httpaf_async.ml\", line 132, characters 10-23"
    "Called from file \"lib/body.ml\", line 115, characters 4-28"
    "Called from file \"lib/parse.ml\" (inlined), line 137, characters 2-26"
    "Called from file \"lib/parse.ml\", line 168, characters 18-31"
    "Called from file \"lib/parser.ml\", line 53, characters 38-43"
    "Called from file \"lib/parse.ml\", line 301, characters 19-53"
    "Called from file \"lib/server_connection.ml\", line 244, characters 17-50"
    "Called from file \"async/httpaf_async.ml\", line 38, characters 12-44"
    "Called from file \"async/httpaf_async.ml\", line 113, characters 14-127"
    "Called from file \"src/job_queue.ml\", line 159, characters 6-47"
    "Caught by monitor (id 6)"))
^C

As you can see it issues eof, but there is no data returned

curl --data-binary @/boot/initrd.img-4.15.0-23-generic http://localhost:8080 | wc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 55.6M    0     0  100 55.6M      0  36.5M  0:00:01  0:00:01 --:--:-- 36.5M
curl: (52) Empty reply from server
      0       0       0

This is built from the current master against faraday 0.5.1 and async v0.11.0, though I also got the same with faraday pinned to bd1a9321 (the lwt PR).

@seliopou
Copy link
Member

If this is indeed caused by writev returning EINVAL that's caused by the iovec arguments rather than the file descriptor.

@seliopou seliopou added the bug label Jun 24, 2018
@seliopou
Copy link
Member

seliopou commented Jul 1, 2018

Or it's that the FD is closed. Which is probably what's happening.

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

No branches or pull requests

2 participants