Closed as not planned
Description
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
- Create a project with
spring-boot-starter-web
andspring-boot-starter-graphql
- Add
@EnableAsync
- Add Property
spring.mvc.async.request-timeout=50s
- 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);
}
});
}
- 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