-
Notifications
You must be signed in to change notification settings - Fork 350
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
Mint adapter cannot upload more than 65535 bytes on HTTP/2 #394
Comments
Hi @jayjun, thanks for reporting the issue. |
Unfortunately not at the moment because I don’t have the bandwidth to learn Tesla internals, Mint and HTTP/2 enough to do a good job. |
If someone hits this error until this is solved, as a temporary solution Tesla.post(client, url, content, [opts: [adapter: [protocols: [:http1]]]]) |
Bumping this since this is a serious issue! Thank you for all the work on Tesla! |
@sheharyarn do you have some bandwidth to tackle the issue? |
@yordis I can definitely try, but would need someone to push me in the right direction. While I have a good amount of experience with Tesla in general, I don't have enough experience with Mint's internals. |
There's a well documented error with Tesla where the http2 cannot send more than 65535 bytes. The issue is documented here: elixir-tesla/tesla#394 This is a workaround until Tesla gets their workaround implemented.
http2 file uploads were causing consistent errors due to the window size not being updated by the mint adapter elixir-tesla/tesla#394
http2 file uploads were causing consistent errors due to the window size not being updated by the mint adapter elixir-tesla/tesla#394
To reproduce,
returns
:exceeds_window_size
error.Full error
That is because
window_size: 65535
is set initially, according to standard, but is not updated when the server sends WINDOW_UPDATE frames.Each time Tesla sends data using
Mint.HTTP.stream_request_body
, the window size is decremented by data’s size. When the window size gets low, the server sends WINDOW_UPDATE frames to increment the connection’s window size. CallingMint.HTTP.stream
to read responses will automatically do this.https://github.com/teamon/tesla/blob/754d4a6ffe41ff508fc7fa460508a40e965b2960/lib/tesla/adapter/mint.ex#L178-L187
However, the adapter repeatedly calls
Mint.HTTP.stream_request_body
without callingMint.HTTP.stream
so the window size hits zero and Mint errors.The text was updated successfully, but these errors were encountered: