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

Detect Inf before casting float to int #3644

Closed
bboreham opened this issue Sep 5, 2022 · 7 comments · Fixed by #3762
Closed

Detect Inf before casting float to int #3644

bboreham opened this issue Sep 5, 2022 · 7 comments · Fixed by #3762
Assignees
Labels
bug Something isn't working

Comments

@bboreham
Copy link

bboreham commented Sep 5, 2022

Report

This line:

metric := GenerateMetricInMili(metricName, val)

is called on output from Prometheus, which may be +Inf.

It calls

valueMili := int64(value * 1000)

where the value is cast to an int. This does not go well; it might result in a number like -9223372036854776000.

Expected Behavior

Not generate bogus values. Maybe treat it the same as "null", handled a few lines earlier?

Actual Behavior

image

Steps to Reproduce the Problem

Sorry I don't know much about running Keda; I'm debugging someone else's problem.
For the purpose of demonstrating the problem, you can use PromQL 1/0, that returns +Inf.

Logs from KEDA operator

No response

KEDA Version

2.7.1

Kubernetes Version

1.22

Platform

Google Cloud

Scaler Details

HPA

Anything else?

No response

@bboreham bboreham added the bug Something isn't working label Sep 5, 2022
@tomkerkhove tomkerkhove moved this to Proposed in Roadmap - KEDA Core Sep 5, 2022
@dannykopping
Copy link

It would be greatly appreciated if the fix could be backported to v2.7 as we (Grafana Labs, who ❤️ KEDA!) are currently staying one minor version behind for stability.

@JorTurFer
Copy link
Member

hey,
This make sense totally, are you willing to contribute with the fix?

@JorTurFer
Copy link
Member

JorTurFer commented Sep 13, 2022

It would be greatly appreciated if the fix could be backported to v2.7 as we (Grafana Labs, who ❤️ KEDA!) are currently staying one minor version behind for stability.

For the moment, we don't backport changes, each release is distributed as it is, sorry :(
Am I right @kedacore/keda-core-contributors ?

@JorTurFer
Copy link
Member

Another question, are you open to be listed as KEDA users 😄 ?
https://github.com/kedacore/keda-docs#become-a-listed-keda-user

@JorTurFer
Copy link
Member

JorTurFer commented Oct 18, 2022

@kedacore/keda-core-contributors ? 🔝 🔝

@JorTurFer
Copy link
Member

@kedacore/keda-core-contributors ?
#3644 (comment)

@JorTurFer
Copy link
Member

hey @bboreham
Do you think this change could be enough? #3762

Repository owner moved this from Proposed to Ready To Ship in Roadmap - KEDA Core Nov 4, 2022
@JorTurFer JorTurFer moved this from Ready To Ship to Done in Roadmap - KEDA Core Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants