Metrics not disposed for `GracefulShutdownInstrumentedPool`
rs017991 opened this issue · comments
When working with various ConnectionProvider/MetricRegistrar arrangements, I am able to verify deRegistration of Metrics when I dispose the provider, but only if I do not set anything for disposeTimeout
. Once I add that, it loses the ability to deregister its Metrics.
Expected Behavior
ConnectionProvider
Metrics should be deRegistered on dispose, regardless of disposeTimeout
use.
Actual Behavior
When adding disposeTimeout
to a ConnectionProvider
, Metrics are no longer deRegistered when the ConnectionProvider
is disposed
Steps to Reproduce
Can reproduce this problem with a tweak to an existing reactor-netty-core
test:
Add to ConnectionProvider
setup in PooledConnectionProviderDefaultMetricsTest.testConnectionPoolPendingAcquireSize
:
.disposeTimeout(Duration.ofSeconds(1))
Possible Solution
In PooledConnectionProvider
, I see that Metric cleanup is only performed in onErrorResume
for the GracefulShutdownInstrumentedPool
block:
whereas in the de facto
else
it is done unconditionally:Perhaps GracefulShutdownInstrumentedPool is supposed to perform the deRegistration on its own happy path, but I see nothing like that in its implementation. Without knowing how it was intended to work, not sure else I can glean...
Your Environment
- Reactor version(s) used: encountered in
1.1.18
; reproduction was just done againstmain
- JVM version:
21
- OS and version:
Windows 11
@rs017991 Thanks for the report and the reproducible example. I confirm that this is an issue and it will be fixed for the next release.