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(input.redis): Discard invalid errorstat lines #15312

Merged
merged 1 commit into from
May 7, 2024

Conversation

nicois
Copy link
Contributor

@nicois nicois commented May 7, 2024

Summary

Some badly-behaved sources (such as dragonfly) may send error messages which are not in the expected format. If errorstat lines are found which do not include an = sign, silently discard them.

Somewhere between 1.26 and 1.28.5, a change was made which caused such missing '=' symbols to cause a panic.

In addition to ignoring such entries, add debug-level logging for this and a similar problem, where the errorstat values are not base-10.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15311

@nicois nicois force-pushed the nicois/handle-invalid-errorstats branch 2 times, most recently from 8f3b59b to f0f9981 Compare May 7, 2024 02:47
@nicois nicois changed the title discard invalid errorstat lines (#15311) fix(plugins.input.reids): Discard invalid errorstat lines (#15311) May 7, 2024
@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label May 7, 2024
@nicois nicois changed the title fix(plugins.input.reids): Discard invalid errorstat lines (#15311) fix(plugins.input.redis: Discard invalid errorstat lines (#15311) May 7, 2024
@nicois nicois changed the title fix(plugins.input.redis: Discard invalid errorstat lines (#15311) fix(plugins.input.redis): Discard invalid errorstat lines (#15311) May 7, 2024
@srebhan srebhan changed the title fix(plugins.input.redis): Discard invalid errorstat lines (#15311) fix(input.redis): Discard invalid errorstat lines (#15311) May 7, 2024
@telegraf-tiger telegraf-tiger bot added area/redis plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels May 7, 2024
Copy link
Contributor

@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 your contribution @nicois! I would prefer to add errors instead of debug logs as this simplifies code, make users more aware and is discoverable on the database side when using the inputs.internal plugin.

What do you think?

plugins/inputs/redis/redis.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this May 7, 2024
@srebhan srebhan changed the title fix(input.redis): Discard invalid errorstat lines (#15311) fix(input.redis): Discard invalid errorstat lines May 7, 2024
@nicois nicois force-pushed the nicois/handle-invalid-errorstats branch from 3ef2f94 to 3c0c0ae Compare May 7, 2024 12:02
…#15311)

Some badly-behaved sources (such as dragonfly) may send error messages
which are not in the expected format. If errorstat lines are found
which do not include an `=` sign, silently discard them.

Somewhere between 1.26 and 1.28.5, a change was made which caused such
missing '=' symbols to cause a panic.

In addition to ignoring such entries, add debug-level logging for this
and a similar problem, where the errorstat values are not base-10.
@nicois nicois force-pushed the nicois/handle-invalid-errorstats branch from 3c0c0ae to 86946df Compare May 7, 2024 12:32
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented May 7, 2024

Copy link
Contributor

@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 @nicois!

@srebhan srebhan 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 May 7, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan May 7, 2024
@powersj powersj merged commit 7f4d27d into influxdata:master May 7, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.30.3 milestone May 7, 2024
powersj pushed 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/redis 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.

Recent telegraf versions panic when receiving invalid errorstats entries
4 participants