Skip to content

Conversation

@passuied
Copy link
Contributor

@passuied passuied commented Oct 22, 2025

Description

Fixing goavro bug due to codec state mutation (linkedin/goavro#299).

Also taking a more defensive approach moving forward, bringing back the old approach that always creates a new codec, which should get rid of the mutation issue altogether in the future...

Added unit test to verify it's fixed

Issue reference

#4067
linkedin/goavro#299

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation / N/A

Note: We expect contributors to open a corresponding documentation PR in the dapr/docs repository. As the implementer, you are the best person to document your work! Implementation PRs will not be merged until the documentation PR is opened and ready for review.

I realized why this problem existed prior to 2.12 but never manifested in our code until 1.16.
This is because the old code was always creating a new codec when serializing (since it had to create a FullStandardJson codec). After the 1.16 change, it was reusing the schema.Codec() which would be subject to mutation issues...

For now, bringing back to old approach that always creates a new codec, which should get rid of the mutation issue altogether...

Signed-off-by: Patrick Assuied <[email protected]>
@passuied passuied requested review from a team as code owners October 22, 2025 15:53
@passuied passuied changed the title Working around current goavro bug (https://github.com/linkedin/goavro/issues/299 until merged). Working around current goavro bug Oct 22, 2025
JoshVanL
JoshVanL previously approved these changes Oct 22, 2025
Copy link
Contributor

@JoshVanL JoshVanL left a comment

Choose a reason for hiding this comment

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

Cheers @passuied 🙂

@alicejgibbons
Copy link

As discussed on the call this is less of a workaround and more of a revert in behaviour to the old 1.15 behaviour.

sicoyle
sicoyle previously approved these changes Oct 22, 2025
Upgrade to latest srclient library as well (small [patch](riferrei/srclient#114))
Added unit test to verify goavro error stays fixed

Signed-off-by: Patrick Assuied <[email protected]>
@passuied passuied dismissed stale reviews from sicoyle and JoshVanL via 8563cd0 October 22, 2025 20:09
@passuied passuied changed the title Working around current goavro bug Fixing goavro bug due to codec state mutation Oct 22, 2025
@passuied passuied requested review from JoshVanL and sicoyle October 22, 2025 20:11
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.57%. Comparing base (862e30c) to head (8563cd0).
⚠️ Report is 10 commits behind head on release-1.16.

Files with missing lines Patch % Lines
common/component/kafka/kafka.go 66.66% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.16    #4070      +/-   ##
================================================
- Coverage         28.57%   28.57%   -0.01%     
================================================
  Files               333      334       +1     
  Lines             42113    42175      +62     
================================================
+ Hits              12034    12050      +16     
- Misses            29076    29121      +45     
- Partials           1003     1004       +1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yaron2 yaron2 merged commit d3d319c into dapr:release-1.16 Oct 22, 2025
94 of 95 checks passed
passuied added a commit to passuied/components-contrib that referenced this pull request Oct 23, 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.

6 participants