micronaut-projects / micronaut-aws

Projects specific to integrating Micronaut and Amazon Web Services (AWS)
Apache License 2.0
82 stars 81 forks source link

AwsApiProxyTestServer doesn't close the web server handler's context and leaks connections #2101

Open dbmeneses opened 3 months ago

dbmeneses commented 3 months ago

Expected Behavior

When AwsApiProxyTestServer is closed, it should release all of its resources.

Actual Behaviour

AwsApiProxyTestServer creates a custom Jetty web server handler AwsProxyHandler. This handler has its own application context. AwsApiProxyTestServer never calls AwsProxyHandler.destroy(), so the application context is never stopped. Since the application context will typically contain a data source, we also have leaked DB connections as a result.

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.3.2

sdelamo commented 2 months ago

do you have a sample application @dbmeneses ?

dbmeneses commented 2 months ago

I don't, but I'll try to provide one next week.