Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@thevilledev
Copy link
Collaborator

1. Why is this pull request needed and what does it do?

Add ReadTimeout, WriteTimeout, and IdleTimeout (5s each) to metrics HTTP server and test to verify timeout behavior prevents hanging connections.

2. Which issues (if any) are related?

None.

3. Which documentation changes (if any) need to be made?

None.

4. Does this introduce a backward incompatible change or deprecation?

No.

Add ReadTimeout, WriteTimeout, and IdleTimeout (5s each) to metrics HTTP
server and test to verify timeout behavior prevents hanging connections.

Signed-off-by: Ville Vesilehto <[email protected]>
@codecov
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.89%. Comparing base (93c57b6) to head (fb67cf9).
⚠️ Report is 1593 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7469      +/-   ##
==========================================
+ Coverage   55.70%   59.89%   +4.19%     
==========================================
  Files         224      274      +50     
  Lines       10016    18140    +8124     
==========================================
+ Hits         5579    10865    +5286     
- Misses       3978     6637    +2659     
- Partials      459      638     +179     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +103 to +105
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
IdleTimeout: 5 * time.Second,
Copy link
Collaborator Author

@thevilledev thevilledev Aug 23, 2025

Choose a reason for hiding this comment

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

These are static configs with IMO sensible defaults. I didn't see much benefit to make these configurable for a metrics endpoint. Happy to hear feedback and thoughts!

Copy link
Member

Choose a reason for hiding this comment

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

Yes I think we can hardcode for now. If there is really great need of parameterize then it can be added later.

@yongtang yongtang merged commit 5a6700c into coredns:master Aug 29, 2025
13 checks passed
@thevilledev thevilledev deleted the fix/plugin-metrics-http-timeouts branch August 29, 2025 05:34
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.

2 participants