You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, packetparser generates an entry in the interfaceLockMap for each new interface that comes up. However, it fails to remove these entries when the interfaces go down. In environments with high pod counts and frequent churn, this can cause the map to grow indefinitely, resulting in a memory leak.
# 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]>
Currently,
packetparser
generates an entry in theinterfaceLockMap
for each new interface that comes up. However, it fails to remove these entries when the interfaces go down. In environments with high pod counts and frequent churn, this can cause the map to grow indefinitely, resulting in a memory leak.The text was updated successfully, but these errors were encountered: