aboutsummaryrefslogtreecommitdiffstats
path: root/test/shutdown_SUITE.erl
AgeCommit message (Collapse)Author
2023-06-05Fix crash when TLS connection closes very earlyLoïc Hoguin
And ensure that we don't infinite loop when retries are enabled, by decrementing the retry count instead of using a new one. Also check for ssl:negotiated_protocol {error,closed} which was possible but was not documented in OTP before this change. Thanks @voluntas for the help.
2023-01-23Update copyright lines in preparation for releaseLoïc Hoguin
2023-01-23Linger a little at the end of a shutdown test connectionLoïc Hoguin
This is to avoid the TCP close eating data.
2022-11-08Include Websocket StreamRef in gun_down messagesWei Huang
2020-11-12Fail fast while closing if reconnect is offViktor Söderqvist
If a request/headers/connect/ws_upgrade is created when a connection is in state 'closing', such as after receiving an HTTP/2 GOAWAY frame or an HTTP/1.1 "Connection: close" header, an error message is sent back to the caller immediately, if reconnect is off (that is if the option retry is set to 0). This allows an application to retry the request on another connection without waiting for all streams on the current connection to complete.
2020-11-12Update copyright yearsLoïc Hoguin
2020-11-12Replace gun:ws_send/2 with gun:ws_send/3Loïc Hoguin
Switching from /2 to /3 should be easy enough. Also update the documentation about HTTP/2 Websocket support.
2020-04-16Tentatively fix a shutdown_SUITE intermittent errorLoïc Hoguin
2020-03-28Use timetrap instead of normal timeouts in shutdown_SUITELoïc Hoguin
2020-03-23Tweak connection timeouts tests for WindowsLoïc Hoguin
It seems that the retry behavior changed recently. It would be better to retrieve the exact values and calculate how much time we want to wait but that will do for now.
2019-09-22Account for Windows' 3-connect pattern in shutdown_SUITELoïc Hoguin
When Windows can't connect it retries 2 more times with 500ms wait in-between by default.
2019-09-22Add Socks5->HTTP/2 testsLoïc Hoguin
Also consolidate the ALPN code in the tls_handshake state rather than doing it in CONNECT/Socks separately. Also improves the origin tests by sending a message once the handshake is completed instead of having timeouts.
2019-09-06Fix failing tests caused by DATA no longer being sentLoïc Hoguin
2019-09-05Implement graceful shutdownLoïc Hoguin
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.