Skip to content
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

fix: mesgdef should clear array pool directly #479

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

muktihari
Copy link
Owner

  • Since we use append on field array pool, it may grow more than the size of the field array pool. New underlying array will be created, leave behind field array pool data untouched when doing clear.
  • There is also bug on clearing field array pool on creating unknown messages, if we end up creating new slice, clear(arr[:len(unknownFields)]) may panic as the len of unknownFields is more than arr.

@muktihari muktihari added the bug Something isn't working label Oct 4, 2024
@muktihari muktihari added this to the v0.24.2 milestone Oct 4, 2024
@muktihari muktihari self-assigned this Oct 4, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b85b163) to head (8f7976e).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #479   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         3810      3810           
=========================================
  Hits          3810      3810           

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

@muktihari muktihari merged commit 405d6b0 into master Oct 4, 2024
5 checks passed
@muktihari muktihari deleted the fix/mesgdef-should-clear-array-pool-directly branch October 4, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants