Repository navigation
Conversation
Frames received while no stream exists no longer restart idle_timeout. A client request restarts it when its stream is created. Data received while a stream exists still restarts it. Server push does not.
| idle_timeout (60000):: | ||
|
|
||
| Time in ms with no data received before Cowboy closes the connection. | ||
| Time in ms before Cowboy closes the connection. |
There was a problem hiding this comment.
Non-blocking: "before Cowboy closes the connection" no longer says what is being timed. Something like "with no activity" plus the rule below would read better. The last two sentences of the paragraph also say the same thing twice.
| The timer is reset when a request stream is created, and when | ||
| data is received while a stream exists. Frames received while | ||
| no stream exists do not reset it. A header block that does not | ||
| create a stream does not reset it either. |
There was a problem hiding this comment.
Non-blocking: a request that is rejected before a stream is created is not counted, and that includes requests answered by early_error (CONNECT/TRACE, 501). Reproduced: with idle_timeout 1000, a client sending one TRACE every 300ms and getting a 501 each time is closed after about 1.2s. On master it stays open. Valid requests (GET every 300ms) stay open. Probably fine, but a request that gets a response is arguably in progress.
| %% The connection goes away soon after we stop sending data. | ||
| timer:sleep(1000), | ||
| {ok, << _:24, 7:8, _:72, 0:32 >>} = gen_tcp:recv(Socket, 17, 1000), | ||
| %% Longer than the idle timeout. A PING used to reset it. |
There was a problem hiding this comment.
Non-blocking: "A PING used to reset it." is history, not intent. Drop that sentence.
| cowboy:stop_listener(?FUNCTION_NAME) | ||
| end. | ||
|
|
||
| do_start_idle_listener(Name, Config, IdleTimeout) -> |
There was a problem hiding this comment.
Non-blocking (erlanger): six new tests and eight do_* helpers (about 25s of added runtime). Bodies should be inline, and ping_without_request, ping_after_request and continuation_without_request overlap. The suite already has do_handshake. Checked: the first three fail on master and request_resets fails if the headers_frame reset is removed. push_does_not_reset fails if that reset is made unconditional.
Frames received while no stream exists no longer restart idle_timeout. A client request restarts it when its stream is created. Data received while a stream exists still restarts it. Server push does not.
I'm not sure this will be ready in time for 2.22 so it might ship in 2.23 instead.