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

Unexpected 'Error during req_read' from pico #21316

Closed
kpeters58 opened this issue Apr 20, 2024 · 1 comment · Fixed by #21480
Closed

Unexpected 'Error during req_read' from pico #21316

kpeters58 opened this issue Apr 20, 2024 · 1 comment · Fixed by #21480
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@kpeters58
Copy link

kpeters58 commented Apr 20, 2024

Describe the bug

image

Reproduction Steps

Tested the throughput of vweb/pico using Bomardier.

Built an exe from https://github.com/vlang/v/blob/master/examples/pico/pico.v (using tcc)

Tested with various connection counts (Bombardier's 'c' parameter) and the exe reports one req_read error for every connection, i.e, 5 errors for 5 connections, 20 for 20 connections and so forth.

Expected Behavior

To see Bombardier finish without pico emitting any error messages.

Current Behavior

Exe emits one 'Error during req_read' per connection

Possible Solution


Additional Information/Context


V version

0.4.5 2baa11b

Environment details (OS name and version, etc.)

Win11 Pro

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@kpeters58 kpeters58 added the Bug This tag is applied to issues which reports bugs. label Apr 20, 2024
@4kbyte
Copy link
Contributor

4kbyte commented May 9, 2024

Same issue on Linux with v run pico.v and siege http://localhost:8089.

Note that the benchmark reports the server as online without dropping any requests.

Printing the server response in the benchmark shows that the server is replying as expected, even when reporting Error during req_read internally:

# sample response from:
# siege --print --concurrent=10 --reps=100 http://localhost:8089

GET / HTTP/1.0
Host: localhost:8089
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (pc-x86_64-linux-gnu) Siege/4.1.6
Connection: close


Hello Picoev!

Increasing to 20k requests (20x1000 on a 24-core machine) sometimes shows something like this at the end of log output:

Error during req_read
Error during accept
Error during req_read
Error during req_read
Error during accept
Error during accept
Error during accept
Error during accept
Error during accept
Error during accept
Error during accept
Error during req_read
Error during req_read

Again, all requests are successful in the benchmark.

The underlying issue is that C recv and accept calls can reply with EAGAIN or EWOULDBLOCK on a -1 return value, which is to be expected for the asynchronous picoev event loop server.

The fix is to continue silently in the cases of EAGAIN or EWOULDBLOCK.

Patch incoming.


V 0.4.5 6a6d8e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants