mrproliu opened a new pull request, #13898: URL: https://github.com/apache/skywalking/pull/13898
### Fix [Bug] Continuous profiling policy validation: condition doesn't match error message (#13832) - [ ] Add a unit test to verify that the fix works. - [x] Explain briefly why the bug exists and how to fix it. In `ContinuousProfilingMutationService.validatePolicyItem()` / `validatePolicyItemWindows()`, the validation conditions used `< 0` while the error messages said "must bigger than zero". The condition therefore accepted `0`, contradicting the message. `0` is not a meaningful threshold. In skywalking-rover the profiling trigger fires when `value >= threshold` (`system_checker.go`, `http_checker.go`) and a time window matches when `matchedCount >= count` (`windows.go`). A threshold or count of `0` is always satisfied, i.e. it would trigger profiling unconditionally. Fix (Option A — fix the condition to match the message semantics): - `PROCESS_THREAD_COUNT`, `SYSTEM_LOAD`, `HTTP_AVG_RESPONSE_TIME`: `< 0` → `<= 0`. - `count` window check: `< 0` → `<= 0` (same bug, not flagged in the issue). - `PROCESS_CPU`, `HTTP_ERROR_RATE`: tightened from `[0-100]` to `(0-100]` for consistency (a `0%` threshold also always triggers). - Fixed message grammar: "must bigger than zero" → "must be bigger than zero", "small than" → "smaller than". - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #13832. - [x] Update the [\`CHANGES\` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
