-
Notifications
You must be signed in to change notification settings - Fork 145
feat(gateway): add configurable fallback timeout for the gateway handler #1069
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1069 +/- ##
==========================================
- Coverage 61.25% 61.20% -0.05%
==========================================
Files 268 268
Lines 26284 26290 +6
==========================================
- Hits 16100 16092 -8
- Misses 8507 8519 +12
- Partials 1677 1679 +2
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing users to override or remove 1h timeout here is a sensible feature, but wiring it up needs to be done in Config (see comment below)
|
|
||
| ### Added | ||
|
|
||
| - `gateway`: Added a configurable fallback timeout for the gateway handler, defaulting to 1 hour, overridable via the BOXO_GATEWAY_REQUEST_TIMEOUT environment variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acejam The existing gateway configuration uses a boxo/gateway/Config struct with explicit fields (e.g., RetrievalTimeout, MaxConcurrentRequests). Using an environment variable is inconsistent with the established pattern and we can't merge this in this form.
Consider adding MaxRequestDuration to the Config struct instead? This would be consistent with how other timeouts are configured and allows programmatic
Added a configurable fallback timeout for the gateway handler, defaulting to 1 hour. Configurable via `MaxRequestDuration` in the gateway config. Replaces #1069
Added a configurable fallback timeout for the gateway handler, defaulting to 1 hour. Configurable via `MaxRequestDuration` in the gateway config. Replaces #1069
|
Replaced by #1079 |
This PR adds a configurable fallback request timeout to the Gateway handler.
fallbackRequestTimeout(default 1h) used inhandler.ServeHTTPinstead of a hardcodedtime.HourBOXO_GATEWAY_REQUEST_TIMEOUTat init (Go duration format: "90m", "2h", "5400s")Impact
BOXO_GATEWAY_REQUEST_TIMEOUTis setRetrievalTimeoutUsage