Age | Commit message (Collapse) | Author |
|
|
|
|
|
Gun was very inefficient at receiving HTTP/2 bodies. Switching
to ensure_window and increasing the default window sizes brings
the response body reading performance at least on par with the
one for HTTP/1.1.
This has a small negative impact on message flow control because
we stop updating the window later than we did before, increasing
the number of extra messages we may send. The exact amount depends
on configuration and the exact moment flow control kicks in.
|
|
|
|
The graceful shutdown is implemented through a new 'closing'
state. This state is entered under different circumstances
depending on the protocol.
The gun:shutdown/1 function is now implemented and documented.
It allows shutting down the connection gracefully regardless
of the current state of the connection and for all protocols.
The behavior is entirely dependent on the protocol.
For HTTP/1.1 the connection stays up only until after the
current stream is complete; other streams are immediately
canceled.
For HTTP/2 a GOAWAY frame is sent and existing streams
continue to be processed. The connection is closed after
all streams are processed and the server's GOAWAY frame
is received.
For Websocket a close frame is sent. The connection is
closed when receiving the server's close frame.
In all cases the closing_timeout option defines how long
we wait, as a maximum, before closing the connection after
the graceful shutdown was started.
The graceful shutdown is also initiated when the owner
process goes away; when sending an HTTP/1.1 request
with the connection: close header; when receiving an
HTTP/1.1 response with the connection: close header;
when receiving an HTTP/1.0 response without a connection
header; when the server sends a GOAWAY HTTP/2 frame;
or when we send or receive a Websocket close frame.
Along with these changes, the gun:ws_send/2 function
now accepts a list of frames as argument. Those frames
may include a close frame that initiates the graceful
shutdown.
|
|
|
|
|
|
On Windows the timings can be flaky. It's better to retry a
few times rather than fail immediately.
|
|
Should improve test success rates on Windows.
|
|
|
|
Flow control is disabled by default. The initial flow value
must be set to enable it (either for the entire connection
or on a per-request basis). Flow applies to all HTTP streams
as well as Websocket. HTTP/2 pushed streams receive the same
value as their originating stream.
|
|
|
|
|
|
|
|
Also test protocol_changed over CONNECT.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This changes the way we connect to servers entirely. We now have
three states when connecting (domain_lookup, connect and
tls_handshake when applicable) and as a result three corresponding
timeout options. Each state has a start/end event associated and
the event data was tweaked to best match each event. Since the
TLS handshake is separate, the transport_opts option was also
split into two: tcp_opts and tls_opts.
|
|
|
|
And ensure that Websocket triggers all the request/response
events.
|
|
|
|
Thought it needed cow_http2_machine changes but everything
was available. For HTTP/1.1 it is triggered when receiving
data while expecting headers. For HTTP/2 it is triggered
after we have received a HEADERS frame for streams in idle
state.
|
|
This covers many scenarios but more need to be added.
|
|
That test will need to be converted to CT and improved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No need to have the error repeated in the logs by the Gun process.
|
|
On Windows when the connection is refused the OS will retry
3 times before giving up, with a 500ms delay between tries.
This adds approximately 1 second to connection failures.
|
|
ssl:handshake/2 was introduced in OTP 21.
|
|
|
|
|
|
|
|
There is now a not_connected state that is used to postpone
events that can't be processed when the proxy socket is not
ready.
|
|
Still need to add ALPN support and to wait before trying to send
data on a proxied TLS connection that didn't complete its handshake.
|
|
|
|
Better skip than fail when a distribution has a too old Go.
|
|
|
|
|
|
|
|
|