[Bug] Continuous profiling policy validation: condition doesn't match error message
bugbackend
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
### Apache SkyWalking Component
OAP server (apache/skywalking)
### What happened
In ContinuousProfilingMutationService.validatePolicyItem(), the validation condition uses < 0 but the error messages say "must bigger than zero".
https://github.com/apache/skywalking/blob/9e57d91daae1a7511d1e34584fd573af557364c6/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/continuous/ContinuousProfilingMutationService.java#L127-L128
https://github.com/apache/skywalking/blob/9e57d91daae1a7511d1e34584fd573af557364c6/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/continuous/ContinuousProfilingMutationService.java#L133-L134
https://github.com/apache/skywalking/blob/9e57d91daae1a7511d1e34584fd573af557364c6/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/continuous/ContinuousProfilingMutationService.java#L145-L146
### What you expected to happen
The validation condition should match the error message semantics. There are two possible fixes:
Option A - Fix the condition: Change < 0 to <= 0, since a threshold of 0 (e.g., 0 threads, 0 system load) has no practical meaning as a
profiling trigger (it would mean "always trigger").
Option B - Fix the message: Change the message to "must be equal to or bigger than zero" (i.e., "must not be negative"), if 0 is
intentionally allowed as a valid threshold.
I'd like to hear from the maintainers which direction is correct before submitting a PR.
### How to reproduce
omit
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
1 条评论