Skip to content

Fix memo payload metadata memory sharing bug #901

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

Merged
merged 2 commits into from
Jun 17, 2025

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison commented Jun 17, 2025

Bug fix: when codec.decode() returns its input unchanged, the subsequent metadata.clear() accidentally cleared the new metadata contents.

@dandavison dandavison requested a review from a team as a code owner June 17, 2025 00:52
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

lgtm. Maybe using one of the copy functions is semantically a bit nicer? I'm fine either way

@dandavison dandavison force-pushed the memo-payload-metadata-memory-sharing-bug branch from 8dc5696 to db122e1 Compare June 17, 2025 00:54
@dandavison dandavison force-pushed the memo-payload-metadata-memory-sharing-bug branch from db122e1 to e24fb30 Compare June 17, 2025 00:58
@dandavison
Copy link
Contributor Author

lgtm. Maybe using one of the copy functions is semantically a bit nicer? I'm fine either way

It's a protocol buffers ScalarMap so it doesn't have .copy(). I think dict(...) on a mapping type is pretty explicit shallow-copy semantics. (If I saw copy.copy() I'd wonder why).

@dandavison dandavison merged commit 35b1a35 into main Jun 17, 2025
32 of 37 checks passed
@dandavison dandavison deleted the memo-payload-metadata-memory-sharing-bug branch June 17, 2025 16:34
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.

2 participants