reactor-netty: Memory leak when enabling `wiretap` (and other tcpClient bootstrap options)
Expected Behavior
Adding wiretap (or other tcpClient bootstrap options should not create excessive Micrometer meters.
Actual Behavior
When enabling HttpClient.create().wiretap(true)
extra metrics are created like so:
reactor_netty_connection_provider_http_active_connections{id="1461210734",remote_address="localhost:443",} 0.0
reactor_netty_connection_provider_http_active_connections{id="1140564265",remote_address="localhost:443",} 0.0
This is because the id is generated from the hashcode
of the BootStrap and the BootStrap is a lambda. (see https://github.com/reactor/reactor-netty/blob/d6a4300c69a8deb83f2e252e576975833faaab87/src/main/java/reactor/netty/resources/PooledConnectionProvider.java#L168)
Steps to Reproduce
Create an HttpClient and enable metrics(true).wiretap(true)
and make several calls and check the meter registry.
Possible Solution
Don’t use a hashcode for the id. Or leave the ID off by default.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (9 by maintainers)
Links to this issue
Commits related to this issue
- fix #988 Correctly generate the connection pool key when wiretap(String, LogLevel) — committed to reactor/reactor-netty by violetagg 4 years ago
@checketts @skmedishetty Please move the discussion to the appropriate channels. I don’t think this issue is the right place.