Skip to content

[Bug] Continuous profiling policy validation: condition doesn't match error message #13832

@eye-gu

Description

@eye-gu

Search before asking

  • I had searched in the issues 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".

if (threadCount < 0) {
return "the process thread count must bigger than zero";

if (httpAvgResponseTime < 0) {
return "the HTTP average response time must bigger than zero";

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?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

Labels

backendOAP backend related.bugSomething isn't working and you are sure it's a bug!

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions