-
Couldn't load subscription status.
- Fork 6.2k
Description
Describe the bug
We use Spring Boot version is 3.1.4 with Webflux as well as Spring Cloud Gateway for our application. The metric called spring.security.filterchains.active holds a increasing number of activeTasks in the metric DefaultLongTaskTimer from Micrometer. It seems that the instrumentation from Spring Security does not stop the active tasks such that the number of activeTasks keeps increasing. We have observed more than 8 million activeTasks for this metric. However, we don't have issue with other metrics from Spring Security such as spring.security.authorizations. Please see the screenshots about heapdump analysis below:

This happens in our production environments in which there are relatively high request amount.
To Reproduce
I tried to reproduce it locally and I have not made it successfully. More information could also be found in this issue micrometer-metrics/micrometer#4221
Expected behavior
Only a small amount of activeTasks are stored for the metric as it only keeps the active requests going through the security filter chains.