question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dealing with large requests: possibility to set max_incomplete_event_size for h11

See original GitHub issue

Checklist

  • There are no similar issues or pull requests for this yet.
  • I discussed this idea on the community chat and feedback is positive. (Asked in the chat, but no response received)

Is your feature related to a problem? Please describe.

I’m working on an application that needs to deal with large http headers, but I’m getting the following exception:

WARNING:  Invalid HTTP request received.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
    event = self.conn.next_event()
  File "/usr/local/lib/python3.9/site-packages/h11/_connection.py", line 432, in next_event
    raise RemoteProtocolError(
h11._util.RemoteProtocolError: Receive buffer too long

Describe the solution you would like.

This error could be fixed if I was able to configure the max_incomplete_event_size of the h11 connection:

https://github.com/python-hyper/h11/blob/master/h11/_connection.py#L119

Describe alternatives you considered

For the time being, I’ve moved to Hypercorn which does allow me to change that parameter.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Kludexcommented, Jun 10, 2022

Be aware that I’d need to study this issue again, so it’s not a promise of merging it. But if you work on the PR, I’ll try my best to follow up.

1reaction
Kludexcommented, Jun 10, 2022

I can review it if you continue the previous implementation. I’ve written some comments over there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deployment - Uvicorn
To see the complete set of available options, use uvicorn --help : ... --h11-max-incomplete-event-size INTEGER For h11, the maximum number of bytes to ......
Read more >
API documentation — h11 0.14.0+dev documentation
max_incomplete_event_size (int) – The maximum number of bytes we're willing to buffer of an incomplete event. In practice this mostly sets a limit...
Read more >
Read/write capacity mode - Amazon DynamoDB
If your application reads or writes larger items (up to the DynamoDB maximum item size of 400 KB), it will consume more capacity...
Read more >
Invalid cloud configuration command received and ignored
The configuration for an antivirus setup is done by defining rules. ... --h11-max-incomplete-event-size INTEGER For h11, the maximum number of bytes to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found