Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Clean up interfaceLockMap entries on endpoint deletion (#1249)
# Description The packetParser was creating entries in interfaceLockMap for each new interface but failing to remove them when interfaces were deleted. In environments with high pod counts and frequent churn, this caused a memory leak as the map grew indefinitely. ## Related Issue [Potential memory leak in packetparser's interfaceLockMap #1236](#1236) ## Checklist - [X] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [X] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [X] I have correctly attributed the author(s) of the code. - [X] I have tested the changes locally. - [X] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [X] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes ### Solution - Added cleanup of interfaceLockMap entries in the EndpointDeleted case - Improved mutex handling logic to prevent resource leaks - Updated test cases to verify proper cleanup of both tcMap and interfaceLockMap ### Testing - Added comprehensive test coverage for interface deletion scenario - Verified cleanup of both maps in test cases - Tested with high pod churn scenarios ### Impact This fix prevents memory leaks in environments with frequent pod creation/deletion, improving the overall stability and resource usage of the system. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Yerlan Baiturinov <[email protected]>
- Loading branch information