-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Request should not fail on small ReadBufferSize #1873
Comments
I'm afraid that is not possible with how fasthttp is build. It always parses the whole headers on each try and therefor needs the whole headers in the read buffer. Changing this would require quite a big refactor of the header parsing code. |
Thanks @erikdubbelboer for reviewing. I tried to refactor the code with minimal changes to support this and looks like it's working. The code might look ugly but can be refactored better. Can you review it once and if it looks okay, I can raise a PR. This feature could be enabled by a optional flag and callback could be provided for observability if this case occurs so that the user can tune the buffer size.
|
I'm pretty sure this is not going to work. You're storing the return value of |
I tested this locally and it was working properly. The return value of |
Can we not fail request if the req/resp header size is greater than the read buffer size.
I can see a bufio bug was mentioned for tryRead function but looks like it's resolved now. Can we have the above mentioned behaviour?
Also, some callback could also be configured to inform that buffer size was low. Library users could emit metrics and increase the buffer size appropriately to have best balance between memory usage and CPU usage.
@valyala Could you review the request?
The text was updated successfully, but these errors were encountered: