-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 bug where MutatesData would not correctly propogate through connectors #9053
Fix bug where MutatesData would not correctly propogate through connectors #9053
Conversation
a735d8b
to
3ad326f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9053 +/- ##
=======================================
Coverage 91.57% 91.57%
=======================================
Files 316 316
Lines 17147 17161 +14
=======================================
+ Hits 15702 15716 +14
Misses 1150 1150
Partials 295 295 ☔ View full report in Codecov by Sentry. |
3ad326f
to
41274a2
Compare
41274a2
to
6a03bda
Compare
@@ -42,7 +42,7 @@ type metricsConsumer struct { | |||
} | |||
|
|||
func (msc *metricsConsumer) Capabilities() consumer.Capabilities { | |||
return consumer.Capabilities{MutatesData: false} | |||
return consumer.Capabilities{MutatesData: len(msc.mutable) > 0} |
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.
If there is a readonly receiver in the fan-out, it's not mutating. The mutable data will be copied
return consumer.Capabilities{MutatesData: len(msc.mutable) > 0} | |
return consumer.Capabilities{MutatesData: len(msc.mutable) > 0 && len(msc. readonly) == 0} |
Follow up to #9053. @dmitryax pointed out [here](#9053 (comment)) that the fanout consumer will pass original data to a non-mutating consumer if any is available. This PR incorporates that point and updates test expectations accordingly.
This fixes two closely related problems.