Skip to content

Conversation

@TingDaoK
Copy link
Contributor

@TingDaoK TingDaoK commented Oct 24, 2023

Issue #, if available:

  • introduce the idle timeout for request to track the number when request finish sending, and server haven't response in a certain time

Description of changes:

  • Schedule a timeout task to the connection eventloop to kill the connection after the time
  • If the response received, we can safely cancel the timeout task as it's the same thread.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@TingDaoK TingDaoK marked this pull request as ready for review October 24, 2023 19:15
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e099d43) 79.48% compared to head (17e8de3) 79.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
- Coverage   79.48%   79.40%   -0.09%     
==========================================
  Files          27       27              
  Lines       11511    11546      +35     
==========================================
+ Hits         9150     9168      +18     
- Misses       2361     2378      +17     
Files Coverage Δ
source/connection.c 79.63% <100.00%> (+0.08%) ⬆️
source/h1_stream.c 82.32% <100.00%> (+0.07%) ⬆️
source/http.c 52.81% <ø> (ø)
source/h1_connection.c 91.23% <89.13%> (-0.31%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 314 to 317
* This can be overridden per-request by aws_http_make_request_options.idle_request_timeout.
* TODO: Only supported in HTTP/1.1 now, support it in HTTP/2
*/
uint64_t idle_timeout_ms;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we just call this "response timeout" all the way down

Suggested change
* This can be overridden per-request by aws_http_make_request_options.idle_request_timeout.
* TODO: Only supported in HTTP/1.1 now, support it in HTTP/2
*/
uint64_t idle_timeout_ms;
* This can be overridden per-request by aws_http_make_request_options.response_timeout_ms.
* TODO: Only supported in HTTP/1.1 now, support it in HTTP/2
*/
uint64_t response_timeout_ms;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed, sold on response_first_byte_timeout_ms

TingDaoK and others added 2 commits October 26, 2023 10:34
Co-authored-by: Michael Graeb <graebm@amazon.com>
@TingDaoK TingDaoK merged commit a082f8a into main Oct 26, 2023
@TingDaoK TingDaoK deleted the ttfb-support branch October 26, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants