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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

picoev: handle EAGAIN or EWOULDBLOCK quietly #21480

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

4kbyte
Copy link
Contributor

@4kbyte 4kbyte commented May 9, 2024

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.

Fix #21316 by continuing silently in these cases.

As a runtime asynchronous bug, the test is a stressful benchmark. In one terminal:

$ v run pico.v
Starting webserver on http://localhost:8089/ ...

In another (on a 24-core machine):

$ siege --concurrent=22 --reps=5000 http://localhost:8089
...
Transactions:                 110000 hits
Availability:                 100.00 %
Elapsed time:                   7.50 secs
Data transferred:               1.47 MB
Response time:                  0.00 secs
Transaction rate:           14666.67 trans/sec
Throughput:                     0.20 MB/sec
Concurrency:                   20.20
Successful transactions:      110000
Failed transactions:               0
Longest transaction:            0.96
Shortest transaction:           0.00

After this patch, there are no Error during req_read or Error during accept messages. 馃憤

@spytheman spytheman changed the title picoev: Handle EAGAIN or EWOULDBLOCK quietly. picoev: handle EAGAIN or EWOULDBLOCK quietly May 10, 2024
@spytheman spytheman merged commit 1eead82 into vlang:master May 10, 2024
57 checks passed
@4kbyte
Copy link
Contributor Author

4kbyte commented May 10, 2024

Thank you!

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.

Unexpected 'Error during req_read' from pico
2 participants