[Bug] [pulsar-function-go] - bounds check issue on user metrics causing go function crash for stats
command
#20020
Closed
2 tasks done
Labels
type/bug
The PR fixed a bug or issue reported a bug
Search before asking
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 ofgi.getFilteredMetricFamilies
will have alen
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
pulsar-admin functions stats --fqfn tenant/namespace/functionname
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.
The text was updated successfully, but these errors were encountered: