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(tap): Don't send events if output is empty #21143

Closed
wants to merge 1 commit into from

Conversation

ArunPiduguDD
Copy link
Contributor

Overview

When sending output events via tap, we can run into issues with the async channel output type if the output is empty. Add a check to see if the output is empty before attempting to send events.

Testing

Tested with demo_logs, unit tests

@ArunPiduguDD ArunPiduguDD requested a review from a team as a code owner August 23, 2024 17:53
@ArunPiduguDD ArunPiduguDD added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Aug 23, 2024
@@ -182,6 +182,9 @@ impl<'a> TapRunner<'a> {
)
})
.collect();
if output_events.is_empty() {
Copy link
Member

Choose a reason for hiding this comment

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

Rather than this, would it be possible for the channel receiver to be able to handle an empty list of events? Just wondering if you'd considered and discarded that option already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is the buffer size of the channel, if it's too small then the async channel output type will have issues. Though now that I'm thinking about it, this might not be the ideal solution. Let me do some further investigation

Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

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

This looks like an obvious band-aid fix, but makes me wonder how output_events could be empty. Is it something we need to check before this point or handle differently in the output methods?

@ArunPiduguDD
Copy link
Contributor Author

This looks like an obvious band-aid fix, but makes me wonder how output_events could be empty. Is it something we need to check before this point or handle differently in the output methods?

Output events is empty if no events have been processed by the pipeline / the tapped components

@bruceg
Copy link
Member

bruceg commented Aug 23, 2024

Output events is empty if no events have been processed by the pipeline / the tapped components

Right, my question is, how would we reach this point if no events have been processed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants