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

feat: configurable file write timeouts #1653

Merged
merged 6 commits into from
Dec 17, 2024

Conversation

TheoTechnicguy
Copy link
Contributor

This pull request introduces changes to the HTTP server configuration to make it more flexible and configurable. The change include adding a new configuration parameter for write timeouts, updating the HTTP server initialization to use this new parameter, and adjusting the server creation logic accordingly.

This PR answers issue #1606.

This commit adds a write timeout configuration parameter. As it is part
of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 23.

Refs: 0xERR0R#1606
@TheoTechnicguy
Copy link
Contributor Author

I have some lingering questions. Should the read timeouts that are currently hardcoded also be migrated to configurable values (possibly in a separate PR)?
I also did not find any test cases for the parts I touched. Did I miss them?

@TheoTechnicguy TheoTechnicguy marked this pull request as ready for review December 4, 2024 19:36
@0xERR0R
Copy link
Owner

0xERR0R commented Dec 10, 2024

I have some lingering questions. Should the read timeouts that are currently hardcoded also be migrated to configurable values (possibly in a separate PR)? I also did not find any test cases for the parts I touched. Did I miss them?

I would say, it is always better to have some parameters configurable for power user and default values which are ok for the most cases ;)

We don't have any tests which cover http timeouts

Copy link
Owner

@0xERR0R 0xERR0R left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for your contribution! Should I merge your change or do you want to add something?

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.91%. Comparing base (fe84ab8) to head (4744d8f).
Report is 159 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1653      +/-   ##
==========================================
+ Coverage   93.88%   93.91%   +0.02%     
==========================================
  Files          78       80       +2     
  Lines        6361     6572     +211     
==========================================
+ Hits         5972     6172     +200     
- Misses        300      316      +16     
+ Partials       89       84       -5     

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

@TheoTechnicguy
Copy link
Contributor Author

I would say, it is always better to have some parameters configurable for power user and default values which are ok for the most cases ;)

I'll do that.

Should I merge your change or do you want to add something?

IMO, this PR is ready for merging; I intend to add both configuration parameters in separate PRs. If you prefer having them in one bigger PR, I can add the commits here.

TheoTechnicguy added a commit to TheoTechnicguy/blocky that referenced this pull request Dec 13, 2024
This commit adds a request read timeout configuration parameter. As it
is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 22.

Refs: 0xERR0R#1653
TheoTechnicguy added a commit to TheoTechnicguy/blocky that referenced this pull request Dec 13, 2024
This commit adds a request header read timeout configuration parameter.
As it is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 21.

Refs: 0xERR0R#1653
@0xERR0R 0xERR0R merged commit e485df1 into 0xERR0R:main Dec 17, 2024
0xERR0R pushed a commit that referenced this pull request Dec 23, 2024
* feat(config): read read timeout value

This commit adds a request read timeout configuration parameter. As it
is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 22.

Refs: #1653

* feat(server): get read timeout from config

* feat(docs): document additional config parameter

* refactor(server): remove superfluous spaces
0xERR0R pushed a commit that referenced this pull request Jan 1, 2025
* feat(config): read read header timeout value

This commit adds a request header read timeout configuration parameter.
As it is part of the downloading cycle, it is available under
`blocking/loading/downloads`.
The default value comes from `server/http.go` line 21.

Refs: #1653

* feat(server): get read header timeout from config

* feat(docs): document additional config parameter
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