newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 143 forks source link

Memory Leak when using Spring Scheduled Jobs with Reactor and R2DBC Postgres #1961

Closed obenkenobi closed 4 months ago

obenkenobi commented 4 months ago

Description

When I ran a spring boot app that did scheduled jobs that made reactive calls to r2dbc-postgres, I encountered connection failures when connecting to postgres with the agent.

This resulted in a memory leak in my application.

Even disabling the r2dbc-postgres instrumentation did not fix the memory leak though this is most likely related to our reactor instrumentation.

Test App Link

Expected Behavior

No memory leak should be created even with continuous connection failures to postgres.

Steps to Reproduce

Run this test app Test App Link connecting to a local postgres instance. Then stop your postgres instance from running so connection failures begin.

workato-integration[bot] commented 4 months ago

https://new-relic.atlassian.net/browse/NR-286161

obenkenobi commented 4 months ago

This occurs in a scenario where more transactions are being created than completed. This is expected when more reactive operations are being created than finished. There doesn't seem to be anything wrong with the agent. So I am closing the issue.