Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

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

Open
2 tasks done
sijie opened this issue Apr 6, 2023 · 0 comments
Labels

Comments

@sijie
Copy link
Member

sijie commented Apr 6, 2023

Original Issue: apache#20020


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!
@sijie sijie added the type/bug label Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant