Skip to content
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

AmazonTimestreamQuery client object leak #19

Open
rajeiyer opened this issue Jun 28, 2022 · 0 comments
Open

AmazonTimestreamQuery client object leak #19

rajeiyer opened this issue Jun 28, 2022 · 0 comments

Comments

@rajeiyer
Copy link
Contributor

[Issue Description]
CX has identified a memory leak (specifically, a thread leak) in the Timestream JDBC driver version 1.0.2.

There are three location in the driver that create an AmazonTimestreamQuery client object without subsequently calling its shutdown() method. Each new client object creates an AmazonTimestreamQueryEndpointCache which starts a thread to refresh the endpoint discovery cache. That thread will continue to run unless shutdown() is called.

Issue Details:

In each of the 3 locations where this occurs, a new AmazonTimestreamQuery object is created where instead the existing client object associated with the TimestreamConnection should probably be used. These locations are:

  • TimestreamStatement constructor, line 82: object is created, but shutdown is not called on TimestreamStatement.close()
    -TimestreamStatement setQueryTimeout(), line 508: object is created, old object in member variable is discarded and shutdown is never called
  • TimestreamConnection.isValid(), line 312-316: object is created and discarded within the method, shutdown is never called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant