-
Notifications
You must be signed in to change notification settings - Fork 110
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(gateway): add configurable response write timeout #812
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: gitsrc <[email protected]>
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
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.
This commit introduces a configurable response write timeout for the IPFS gateway.
The timeout can be set via the
ResponseWriteTimeout
field in the gateway configuration.If not set, a default timeout of 30 seconds is applied.
The implementation includes:
timeoutResponseWriter
struct that wraps the standardhttp.ResponseWriter
and enforces the timeout.
WithResponseWriteTimeout
that applies the timeout logicto the HTTP handler chain.
The timeout ensures that slow or unresponsive clients do not indefinitely hold
server resources, improving the overall reliability and stability of the gateway.
This change also attempts to address the issue described in #679
by providing a mechanism to handle slow or stuck HTTP responses more gracefully.
[skip changelog]