Skip to content

Add request handling timeout #2500

@AndersSoee

Description

@AndersSoee

Preflight checklist

Describe the background of your feature request

If/when something goes wrong, i would like a way to limit the maximum duration of a request.
We saw recently with #2466 that when the code internally hit a deadlock, the request just hung forever. (it could also be a downstream system misbehaving.)
I would rather it failed loudly, than just hanging, and eating up system resources.

Describe your idea

Add a new configuration option for request timeout, and fail the request, if it takes longer than that.
The net/http TimeoutHandler makes this easy to implement, as shown here:
https://ieftimov.com/posts/make-resilient-golang-net-http-servers-using-timeouts-deadlines-context-cancellation/#handler-timeout

Are there any workarounds or alternatives?

Not that i know of

Version

0.16.3

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureUsed for new features

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions