Skip to content

GraphQL Starter With Starter Web Not Honoring Async Request Timeout #43076

Closed as not planned
@matthew-js-porter

Description

@matthew-js-porter

When using spring-boot-starter-graphql with spring-boot-starter-web and @EnableAsync I would expect it to honor the spring.mvc.async.request-timeout property. Instead it is throwing a AsyncRequestTimeoutException after 30 seconds.

Steps to Reproduce

  1. Create a project with spring-boot-starter-web and spring-boot-starter-graphql
  2. Add @EnableAsync
  3. Add Property spring.mvc.async.request-timeout=50s
  4. Add QueryMapping method that sleeps.
    @QueryMapping
    @Async
    public CompletableFuture<Book> bookById(@Argument String id) {
        return CompletableFuture.supplyAsync(() -> {
            try {
                LOGGER.info("Starting Sleep");
                TimeUnit.SECONDS.sleep(45);
                return Book.getById(id);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
    }
  1. Send Request and observe error

.w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.context.request.async.AsyncRequestTimeoutException]

I observed this behavior using Spring Boot 3.3.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions