Open
Description
Hi Folks,
A canary run on one of our high-RPS services showed a significant performance degradation when upgraded from [email protected]
to 1.4.0
. We skipped the last OSS Spring Boot 3.4 version (3.4.7
) and jumped on 3.5
, so we have never tested [email protected]
.
The flamegraphs show that ContextPropagationHelper.isCancelled() method allocates 3GB of memory:

Potential issues:
- https://github.com/spring-projects/spring-graphql/blob/main/spring-graphql/src/main/java/org/springframework/graphql/execution/ContextPropagationHelper.java#L128-L129 creates a publisher that's stored in context. Shall there be a cleanup mechanism to remove it from the context?
ContextPropagationHelper.bindCancelFrom() calls:
https://github.com/spring-projects/spring-graphql/blob/main/spring-graphql/src/main/java/org/springframework/graphql/execution/ContextDataFetcherDecorator.java#L127-L134 may be creating additional reactive chains that maintain references.- https://github.com/spring-projects/spring-graphql/blob/main/spring-graphql/src/main/java/org/springframework/graphql/execution/ContextPropagationHelper.java#L143 repeatedly converts
Mono
toFuture
withFuture
s and their associated reactive chains potentially accumulating in memory.