management-api-for-apache-cassandra icon indicating copy to clipboard operation
management-api-for-apache-cassandra copied to clipboard

K8SSAND-1656 ⁃ Develop a Test to validate the fix for preventing resource leaks

Open emerkle826 opened this issue 3 years ago • 4 comments

The fix put in for #175 never had a test written to validate the fix actually addresses the resource leak that was assumed to be causing a java.io.IOException: Too many open files issue.

A test should be written to verify the fix correctly addresses the problem.

┆Issue is synchronized with this Jira Story by Unito

emerkle826 avatar Jul 13 '22 14:07 emerkle826

Still working on an automated test to validate the fix, however I was able to run a controlled experiment where Management API was spun up in a Docker container with Cassandra not started. I then repeatedly hit the readiness endpoint. Each request hit the code mentioned above and attempted to create a driver session using the non-existent Unix socket. Two thousand requests were made and each one caused the Management API process file descriptor count to increase. At the end of the test, over 96 thousand file descriptors had been opened by the process. II then tried the experiment again, but with the fix in place. The process file descriptor count never exceeded 82 open FDs.

I’ll continue to try to develop an automated test to trigger this.

emerkle826 avatar Jul 14 '22 20:07 emerkle826

The fix from #175 was applied to DSE without a test. I came up with a test that would try to detect an increase in file descriptors, but the test is too rigid. A new ticket was created to identify the root cause of the resource leak and fix that, along with correcting the test.

emerkle826 avatar Jul 15 '22 14:07 emerkle826

@emerkle826, is this issue still worked on? Should we deprioritize it or maybe close it as won't do?

adejanovski avatar Oct 25 '22 08:10 adejanovski

@adejanovski Definitely de-prioritize. I'm not actively working on it at the moment. I don't know about closing it though. It can linger in the backlog for now as I don't anticipate getting around to this in the near future.

emerkle826 avatar Oct 25 '22 15:10 emerkle826