Skip to content

expfmt: only call TextParser.TextToMetricFamilies once from textDecoder#443

Merged
roidelapluie merged 1 commit intoprometheus:mainfrom
abursavich:expfmt-decode
Feb 20, 2023
Merged

expfmt: only call TextParser.TextToMetricFamilies once from textDecoder#443
roidelapluie merged 1 commit intoprometheus:mainfrom
abursavich:expfmt-decode

Conversation

@abursavich
Copy link
Contributor

@abursavich abursavich commented Feb 9, 2023

Fixes #442

It turns out that TextParser.TextToMetricFamilies reads all metrics the first time and only returns partial results if there's an error. The bug was triggered by calling it twice. We only need to call it once.

Signed-off-by: Andy Bursavich <abursavich@gmail.com>
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Thank you. I think this should work.

@roidelapluie I lease final approval/merge to you.

@roidelapluie roidelapluie merged commit d888bfa into prometheus:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expfmt: TextDecoder infinite bufio Read recursion

3 participants