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

[Bug] [pulsar-function-go] - bounds check issue on user metrics causing go function crash for stats command #20020

Closed
2 tasks done
flowchartsman opened this issue Apr 5, 2023 · 0 comments · Fixed by #20021 · May be fixed by flowchartsman/pulsar#1
Closed
2 tasks done
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@flowchartsman
Copy link
Contributor

flowchartsman commented Apr 5, 2023

Search before asking

  • I searched in the issues and found nothing similar.

Version

issuing a pulsar-admin functions stats check on a go function will cause it to crash if no user metrics are defined. This is because it makes a similar assumption to the other metrics calls that the result of gi.getFilteredMetricFamilies will have a len of at least 1. If there are no user metrics, it will not, and it will cause the agent to restart.

PR incoming

Minimal reproduce step

  1. create go function w/o user metrics
  2. pulsar-admin functions stats --fqfn tenant/namespace/functionname
  3. function will crash/restart

What did you expect to see?

Actual stats

What did you see instead?

stats of zero. function restart

Anything else?

No response

Are you willing to submit a PR?

Considering as this is basically my fault, yes I am willing to submit a PR.

  • I'm willing to submit a PR!
@flowchartsman flowchartsman added the type/bug The PR fixed a bug or issue reported a bug label Apr 5, 2023
@flowchartsman flowchartsman changed the title [Bug] [pulsar-function-go] - bounds check issue on user metrics [Bug] [pulsar-function-go] - bounds check issue on user metrics causing go function crash for stats command Apr 5, 2023
flowchartsman added a commit to flowchartsman/pulsar that referenced this issue Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
1 participant