Skip to content

Conversation

@adev-code
Copy link
Contributor

@adev-code adev-code commented Nov 12, 2025

Remove weakref.proxy usage in RequestSigner. The weakref was added for Python 2.6 memory leak prevention and is no longer needed.

Remove weakref.proxy usage in RequestSigner. The weakref was added for
Python 2.6 memory leak prevention and is no longer needed.

Also revert MAX_GROWTH_BYTES from 13MB back to 10MB in
test_resource_leaks.py now that Python 3.14 support is official.
@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.17%. Comparing base (8121342) to head (f572daf).
⚠️ Report is 90 commits behind head on develop.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3590   +/-   ##
========================================
  Coverage    93.17%   93.17%           
========================================
  Files           68       68           
  Lines        15411    15412    +1     
========================================
+ Hits         14359    14360    +1     
  Misses        1052     1052           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 25 to 28
# that the memory can't increase by more than 13MB.
# that the memory can't increase by more than 10MB.

# TODO: Attempt to bring this back to 10MB once Python 3.14 releases
MAX_GROWTH_BYTES = 13 * 1024 * 1024
MAX_GROWTH_BYTES = 10 * 1024 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are two unrelated fixes, let's try to keep them in separate PRs. From the looks of it, the tests are still using elevated memory, so this change can't be done currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks @nateprewitt 👍🏼

Revert MAX_GROWTH_BYTES from 10MB back to 13MB in test_resource_leaks.py
as tests are still using elevated memory and the reduction cannot be
implemented currently.

The weakref removal changes remain as they are still valid.
@adev-code adev-code changed the title [Fix] Remove weakref usage and revert memory test threshold [Fix] Remove weakref usage in RequestSigner Nov 13, 2025
@adev-code
Copy link
Contributor Author

Based on the CI test failures, it looks like the weakref line needs to stay in place. Removing it causes test failures, which confirms that it's a required part of the implementation. The weakref helps free up memory more quickly. Without it, memory consumption grows substantially over time, making the removal not worthwhile.

Closing.

@adev-code adev-code closed this Nov 20, 2025
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

Successfully merging this pull request may close these issues.

3 participants