-
Notifications
You must be signed in to change notification settings - Fork 102
Fix memory leak in RESP3 map parsing #204
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a memory leak in RESP3 map parsing by adjusting reference count management and error handling in the reader implementation. Key changes include:
- Adding new tests to stress-test memory leak scenarios and unhashable key handling.
- Fixing reference counting in the map parsing in src/reader.c.
- Updating dependencies and CI workflows to support memory profiling with memray.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/test_reader.py | New tests added for detecting memory leaks and unhashable keys. |
src/reader.c | Adjusted reference counts and error handling in map parsing. |
dev_requirements.txt | Updated test dependencies and added memray for memory profiling. |
.github/workflows/integration.yaml | Added steps to install memray dependencies and set environment variables. |
.github/workflows/freebsd.yaml | Updated pip installation to bypass memray on FreeBSD. |
Comments suppressed due to low confidence (1)
src/reader.c:87
- Consider adding error checking after the PyDict_SetItem call in the else branch (using last_key as key) to mirror the error handling in the if branch.
PyDict_SetItem(parent, last_key, obj);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, thank you @uglide!
* Fix memory leak in RESP3 map parsing Fix redis#175 * Add memray deps installation * Install deps only on ubuntu * Disable memray installation on Windows * Another attempt * Fix memray on old macOS versions * Disable memray for PyPy * Exclude FreeBSD * Revert * Another attempt for freebsd fix * Another attempt for freebsd fix (cherry picked from commit 7e77f22)
* Fix memory leak in RESP3 map parsing (#204) * Fix memory leak in RESP3 map parsing Fix #175 * Add memray deps installation * Install deps only on ubuntu * Disable memray installation on Windows * Another attempt * Fix memray on old macOS versions * Disable memray for PyPy * Exclude FreeBSD * Revert * Another attempt for freebsd fix * Another attempt for freebsd fix (cherry picked from commit 7e77f22) * Version 3.1.1 * Run integration workflow on version branches
Fix #175