0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
cowboy/test
Viktor Söderqvist 059d58d39f
Graceful shutdown
Note: This commit makes cowboy depend on cowlib master.

Graceful shutdown for HTTP/2:

1. A GOAWAY frame with the last stream id set to 2^31-1 is sent and a
   timer is started (goaway_initial_timeout, default 1000ms), to wait
   for any in-flight requests sent by the client, and the status is set
   to 'closing_initiated'. If the client responds with GOAWAY and closes
   the connection, we're done.
2. A second GOAWAY frame is sent with the actual last stream id and the
   status is set to 'closing'. If no streams exist, the connection
   terminates. Otherwise a second timer (goaway_complete_timeout,
   default 3000ms) is started, to wait for the streams to complete. New
   streams are not accepted when status is 'closing'.
3. If all streams haven't completed after the second timeout, the
   connection is forcefully terminated.

Graceful shutdown for HTTP/1.x:

1. If a request is currently being handled, it is waited for and the
   response is sent back to the client with the header "Connection:
   close". Then, the connection is closed.
2. If the current request handler is not finished within the time
   configured in transport option 'shutdown' (default 5000ms), the
   connection process is killed by its supervisor (ranch).

Implemented for HTTP/1.x and HTTP/2 in the following scenarios:

* When receiving exit signal 'shutdown' from the supervisor (e.g. when
  cowboy:stop_listener/3 is called).
* When a connection process is requested to terminate using
  sys:terminate/2,3.

LH: Edited tests a bit and added todos for useful tests to add.
2020-11-27 15:38:21 +01:00
..
handlers Graceful shutdown 2020-11-27 15:38:21 +01:00
static_handler_SUITE_data cowboy_static: Add support for files in EZ archives 2017-01-24 11:36:58 +01:00
ws_autobahn_SUITE_data Don't run long test suites by default 2018-11-20 13:23:59 +01:00
ws_SUITE_data Document the commands based Websocket interface 2019-10-06 16:51:27 +02:00
compress_SUITE.erl Ignore malformed accept-encoding headers in cowboy_compress_h 2019-12-31 13:48:05 +01:00
cover.spec Use ct_run instead of rebar ct for running ct tests 2013-01-04 17:56:49 +01:00
cowboy_ct_hook.erl Welcome to 2017 2017-01-02 19:36:36 +01:00
cowboy_test.erl NO_PARALLEL=1 will disable (most) parallel testing 2020-04-06 16:39:28 +02:00
examples_SUITE.erl Use gun:ws_send/3 in tests 2020-11-23 11:02:01 +01:00
h2spec_SUITE.erl Fix h2spec "invalid preface sequence" test 2020-04-01 18:02:59 +02:00
http2_SUITE.erl Graceful shutdown 2020-11-27 15:38:21 +01:00
http_SUITE.erl Graceful shutdown 2020-11-27 15:38:21 +01:00
loop_handler_SUITE.erl Remove a broken test from loop_handler_SUITE 2018-05-17 13:39:35 +02:00
metrics_SUITE.erl Get rid of timeouts in metrics_SUITE 2020-04-08 10:28:11 +02:00
misc_SUITE.erl Silence the expected set_env_missing error 2018-11-20 16:24:56 +01:00
plain_handler_SUITE.erl Move a old HTTP test cases to new plain_handler test suite 2018-11-21 14:29:36 +01:00
proxy_header_SUITE.erl Fix a test listener not being stopped 2018-10-31 09:25:19 +01:00
req_SUITE.erl Fix concurrent body streaming getting stuck with HTTP/2 2020-07-03 11:02:59 +02:00
rest_handler_SUITE.erl Document media type wildcard in content_types_accepted 2019-10-03 16:20:29 +02:00
rfc6585_SUITE.erl Add a test suite for RFC6585 2018-11-03 20:57:51 +01:00
rfc7230_SUITE.erl 204 and 304 responses must not include a body 2020-05-20 13:41:05 +02:00
rfc7231_SUITE.erl Update gun_down messages in test suites 2019-10-02 10:10:43 +02:00
rfc7538_SUITE.erl Add a test suite for RFC7538; update Cowlib to 2.2.0 2018-03-05 16:48:56 +01:00
rfc7540_SUITE.erl Graceful shutdown 2020-11-27 15:38:21 +01:00
rfc8297_SUITE.erl Add a test suite for RFC8297 2018-05-07 13:05:50 +02:00
rfc8441_SUITE.erl Fix and optimize sending of WINDOW_UPDATE frames 2019-09-05 14:07:38 +02:00
security_SUITE.erl Allow {error, enotconn} as test success in security_SUITE 2020-04-07 10:18:29 +02:00
static_handler_SUITE.erl Don't stop listeners that don't exist in static_handler_SUITE 2020-05-20 11:08:24 +02:00
stream_handler_SUITE.erl Fix HTTP/1.1 bug when a flow command is returned after fin 2020-02-07 11:32:15 +01:00
sys_SUITE.erl Don't discard data following a Websocket upgrade request 2019-10-05 13:04:21 +02:00
tracer_SUITE.erl Rely on timetrap timeouts for tracer_SUITE 2020-04-06 20:14:31 +02:00
ws_autobahn_SUITE.erl Don't run long test suites by default 2018-11-20 13:23:59 +01:00
ws_handler_SUITE.erl Use gun:ws_send/3 in tests 2020-11-23 11:02:01 +01:00
ws_SUITE.erl Disable ws_SUITE:unlimited_connections on Windows 2020-04-02 17:36:03 +02:00