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(inputs.gnmi): Ensure path contains elements to avoid panic #15259

Merged
merged 2 commits into from
May 2, 2024

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Apr 29, 2024

Summary

In the event of an empty message, ensure the path actually contains segments to avoid a panic.

Checklist

  • No AI generated code was used in this PR

Related issues

fixes: #15257

@telegraf-tiger telegraf-tiger bot added area/gnmi fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Apr 29, 2024
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 @powersj, this should definitively be there! I think for the issue we should also check if the update is empty and drop processing early without error as here the path lookup isn't the issue but rather an empty message by the device.

@powersj
Copy link
Contributor Author

powersj commented Apr 29, 2024

@srebhan good point - I've pushed another commit, can you confirm that is the right place to bail?

@powersj powersj self-assigned this Apr 29, 2024
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 29, 2024
@powersj powersj assigned srebhan and DStrand1 and unassigned powersj Apr 29, 2024
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.

LGTM! Thanks @powersj!

@srebhan srebhan changed the title fix(inputs.gnmi): Ensure path contains elements, avoid panic fix(inputs.gnmi): Ensure path contains elements to avoid panic Apr 30, 2024
@srebhan srebhan removed their assignment Apr 30, 2024
@DStrand1 DStrand1 merged commit d6671eb into influxdata:master May 2, 2024
29 checks passed
@github-actions github-actions bot added this to the v1.30.3 milestone May 2, 2024
powersj added a commit that referenced this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gnmi fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins 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.

GNMI dialin-in empty metric-name causes Telegraf to stop/restart as service
3 participants