Skip to content

Support a configurable GraphQL request timeout for both reactive and synchronous controllers #1150

@tstocker-black-cape

Description

@tstocker-black-cape

Now that reactive request cancellation is supported (#1149), it would be really nice if we could configure a request timeout for a server. An example use case for this is a GraphQL server that lives behind a reverse proxy and the reverse proxy has a configured max timeout. In this scenario, a may request a GraphQL request and proxy returns a 408, but the server is still executing the potentially long running work. If the server sets the request timeout to the same value as the reverse proxy, it can avoid spending resources processing requests that have already been terminated.

For Reactive requests, the timeout value should be set. For synchronous/virtual thread calls, thread interrupts could be leveraged.

I'd like to see some simple configuration like spring.graphql.timeout=10s

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions