Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration options for net/http timeouts #229

Merged
merged 1 commit into from
Nov 21, 2023
Merged

Add configuration options for net/http timeouts #229

merged 1 commit into from
Nov 21, 2023

Conversation

pkqk
Copy link
Member

@pkqk pkqk commented Nov 15, 2023

These timeouts should be tuneable for users who don't want to limit downstream services to only accept fast responses.

Address #228 by providing the option to increase the write timeout.

@codedge can you give this a review and see if it addresses your issue, it wasn't able to be configured by the limits plugin as it's the main method that sets up the http.Server instances.

In the config.json you can either provide a default-timeouts map of read, write and idle keys that will be used for all the http.Server instances or override the defaults with gateway-timeouts and private-timeouts maps that only need to provide values differing from the defaults.

These timeouts should be tuneable for users who don't want to limit
downstream services to only accept fast responses.
@pkqk pkqk requested a review from a team as a code owner November 15, 2023 03:05
@codecov-commenter
Copy link

Codecov Report

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

Comparison is base (3c1b58b) 71.07% compared to head (71a4e80) 72.24%.

Files Patch % Lines
config.go 41.02% 14 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #229      +/-   ##
==========================================
+ Coverage   71.07%   72.24%   +1.16%     
==========================================
  Files          27       27              
  Lines        2742     2781      +39     
==========================================
+ Hits         1949     2009      +60     
+ Misses        671      631      -40     
- Partials      122      141      +19     

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

@codedge
Copy link
Contributor

codedge commented Nov 15, 2023

Going to check during the day and will let you know.

Thanks already for the fast response!

@codedge
Copy link
Contributor

codedge commented Nov 15, 2023

This works perfectly for me. 👍 Can be merged!

@pkqk pkqk merged commit 08b0247 into main Nov 21, 2023
4 checks passed
@pkqk pkqk deleted the timeouts branch November 21, 2023 22:12
pkqk added a commit that referenced this pull request Nov 28, 2023
Accidentally left in from #229
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