appcues / mojito

An easy-to-use Elixir HTTP client, built on the low-level Mint library.
https://hexdocs.pm/mojito/Mojito.html
MIT License
349 stars 34 forks source link

exceeds_window_size from Mint.HTTP2 when using Mojito.post #54

Closed dch closed 3 years ago

dch commented 4 years ago
{:error, %Mojito.Error{message: nil, reason:
  %Mint.HTTPError{module: Mint.HTTP2,
    reason: {:exceeds_window_size, :request, 65536}}}}

I am seeing this bubble up occasionally from Mojito.post (when POSTing to Wordpress); it looks like Mojito needs to renegotiate the window size after initial setup of the connection, or when this error is returned, and then send chunked data over the stream.

jayjun commented 4 years ago

One workaround is downgrading to HTTP/1.x. https://github.com/appcues/mojito/issues/41

Tesla’s Mint adapter has the same issue. I’ve described why the error happens in detail https://github.com/teamon/tesla/issues/394. The fix is to receive frames occasionally while sending, which could mean rearchitecting the library.

gamache commented 4 years ago

@dch and @jayjun thank you for documenting this. I can't work on this in the next couple of days but I will look into this.

gamache commented 4 years ago

This is confirmed. A workaround is to force HTTP/1 operation by passing protocols: [:http1] in the Mojito request options.