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(common.encoding): Remove locally-defined errors and use upstream ones #14627

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

Snelius30
Copy link
Contributor

@Snelius30 Snelius30 commented Jan 25, 2024

Summary

We have a local defined error (ie ErrShortDst, ErrShortSrc) objects in decoder_reader.go which has transferred from an original transformer package. Those uses inside the Read() function to properly manage a slice allocations. It does not work
cause errors.Is never set to true cause local errors object it's not the same transformer defined errors objects.
I got this error on my production when character_encoding = "utf8" option was used for inputs.file and dst buffer size is not enough to decode obviously.
Well, we need just to use a proper error objects. This PR to solve the problem. Thx.

  • No AI generated code was used in this PR

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jan 25, 2024
@Snelius30
Copy link
Contributor Author

!signed-cla

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @Snelius30!

@srebhan srebhan added error handling Issues related to error handling ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Jan 25, 2024
@srebhan srebhan changed the title fix(common.encoding): Errors handling fix(common.encoding): Remove locally-defined errors and use upstream ones Jan 25, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks!

@powersj powersj merged commit 66bd355 into influxdata:master Jan 25, 2024
28 checks passed
@github-actions github-actions bot added this to the v1.29.3 milestone Jan 25, 2024
powersj pushed a commit that referenced this pull request Jan 29, 2024
hhiroshell pushed a commit to hhiroshell/telegraf that referenced this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Issues related to error handling fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants