You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ReactorResourceFactory in the Spring Framework provides an option to use resources independent of the global ones and to clean those up when the ApplicationContext is closed. This is useful for example in a Spring MVC app using the WebClient where an app may be stopped and started many times without stopping the server. In such cases Tomcat complains about threads being started but not stopped and a memory leak.
This works for LoopResources. However ConnectionProvider#dispose causes elastic-evictor-1 and elastic-2 to be created, which is probably due to the use of Schedulers.elastic() call in PooledConnectionProvider.
Considering the goal of cleaning up resources, dispose should not be creating more resources. Either it should use a different thread that it then also shuts down. Or it should provide a disposeNow method that blocks the current thread. Most often on shutdown you need to wait so this is a useful option to have.
The ReactorResourceFactory in the Spring Framework provides an option to use resources independent of the global ones and to clean those up when the ApplicationContext is closed. This is useful for example in a Spring MVC app using the
WebClient
where an app may be stopped and started many times without stopping the server. In such cases Tomcat complains about threads being started but not stopped and a memory leak.This works for
LoopResources
. HoweverConnectionProvider#dispose
causeselastic-evictor-1
andelastic-2
to be created, which is probably due to the use ofSchedulers.elastic()
call inPooledConnectionProvider
.Considering the goal of cleaning up resources,
dispose
should not be creating more resources. Either it should use a different thread that it then also shuts down. Or it should provide adisposeNow
method that blocks the current thread. Most often on shutdown you need to wait so this is a useful option to have.This was originally reported in spring-projects/spring-framework#23594 and was confirmed against Reactor Netty 0.9 RC1.
The text was updated successfully, but these errors were encountered: