-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Brian Clozel opened SPR-17199 and commented
When configured in global mode, ReactorResourceFactory
creates ConnectionProvider
and LoopResources
instances, then set those into Reactor HttpResources
.
When the ReactorResourceFactory
bean is being destroyed, those resources are being cleaned with their respective destroy
method, without touching the global HttpResources
itself.
When running multiple contexts in a row within the same JVM, here is what happens:
- Global resources are created by
ReactorResourceFactory
and set onHttpResources
- the application context is detroyed,
ReactorResourceFactory
cleans those resources - Given the nature of
HttpResources
, it is still holding a reference to those resources, even though they've been disposed - Another test runs and is just using a reactor netty server or client, not using a
ReactorResourceFactory
bean; it checks thatHttpResources
holds an instance already and is trying to use it - Netty fails while submitting a task as those resources are disposed already
Reactor Netty just checks the presence of an HttpResources
instance but does not test that the contained resources are valid (or were disposed from a 3rd party). In global mode, ReactorResourceFactory
should call HttpResources.disposeLoopsAndConnections()
directly.
Affects: 5.1 RC2
Issue Links:
- Externally managed mode for ReactorResourceFactory [SPR-17243] #21776 Externally managed mode for ReactorResourceFactory
Referenced from: commits spring-projects/spring-boot@2af8a96