-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak when enabling wiretap
(and other tcpClient bootstrap options)
#988
Comments
@checketts What's Reactor Netty version? |
reactor-netty version |
@checketts In the logs how many times do you see |
@checketts I found an issue when |
I just tested with 0.9.5-BUILD-SNAPSHOT and the HttpClient.create()
.metrics(true)
.tcpConfiguration { tc -> tc.bootstrap{ b ->
BootstrapHandlers.updateLogSupport(b, CustomLogger(CustomLogger::class.java))}
} I'm making the calls via the CloudFoundry client. So not using the
|
This is the problem
either extract this is because we keep track of the channels configuration in the connection pool i.e. all channels in one connection pool have exactly one and the same configuration. With the coding above you always change the take a look at the fix that I applied for |
OK adding in hashcode implementation fixed that custom logger. Thanks! Was there any other testing or validation you would like me to do? |
@checketts why do you use a custom handler and not one of the |
The wiretap outputs a bunch of hex with the text. So my custom one is just outputting the text. I only saw one wiretap option ( |
is your handler doing something like this netty/netty#9915 (this will be in Netty 4.1.46) there are several |
Yes! That is pretty much what I need. (Though truly my wiretap efforts are a short term need to debug some prod issues) |
OK I'll open a feature request in order to support this new functionality. |
this is the feature request #989 |
@violetagg @twoseat I upgraded 0.9.5 reactive-netty and cloud-foundry to 4.4.0 now I don't see memory issue but see below error Do you guys have idea why it fails after couple of hours ? |
This is because of the latest change in cloudfoundry-java-client 4.4.0 (cloudfoundry/cf-java-client#1029) Before it would retry unlimited times to refresh the token when it expired. Now it just does 5 times (though it is configurable). So you'll probably want to add your own retry/resumeOnError to your code. We could move this to stackoverflow if you have more questions. |
@checketts I changed timeout to 20 seconds even after that it timeout. Why things becoming slow when system run for long duration.. did we tested this using new jars? |
I just upgraded yesterday and am also seeing this behavior. I'm seeing my heap getting filled up, so the slowness is likely due to another leak. I'll try to do a dump today and see if I can get some analysis. I had been running with the SNAPSHOT version fine when this had gotten fixed, so it must be something new.
That is a CloudFoundry config (I haven't operated my own CF, so I don't know much beyond that). It is an OAuth token, so it should be set to expire eventually. I guess a given installation could make them last incredibly long, but that would be a poor (and incomplete) solution to this. |
Nevermind. When I had 'upgraded' I had a typo and had actually downgraded. So at this point reactor-netty 0.9.5 and cloudfoundry-java-client 4.4.0 are both working great. |
@checketts can you please share the config where you are initiating client. also what is the spring boot version you are working on ? |
@checketts @skmedishetty Please move the discussion to the appropriate channels. I don't think this issue is the right place. |
@violetagg agreed. Sorry for the noise. @skmedishetty this belongs on stackoverflow as a question or as an issue on the cloudfoundry-java-client if you think it is a regression. |
@violetagg apologies I will check in stackoverflow. |
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:This is because the id is generated from the
hashcode
of the BootStrap and the BootStrap is a lambda. (seereactor-netty/src/main/java/reactor/netty/resources/PooledConnectionProvider.java
Line 168 in d6a4300
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.
The text was updated successfully, but these errors were encountered: