From 33c0e8e67b0ac45d05193adc7e6d5d4c04035af9 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Fri, 28 Mar 2025 22:26:38 +0800 Subject: [PATCH] Fix query continues profiling policies error when the policy is already in the cache (#13155) --- docs/en/changes/changes.md | 1 + .../handler/ContinuousProfilingServiceHandler.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index e71224299f..1a689090fa 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -5,6 +5,7 @@ #### OAP Server * BanyanDB: Support `hot/warm/cold` stages configuration. +* Fix query continues profiling policies error when the policy is already in the cache. #### UI diff --git a/oap-server/server-receiver-plugin/skywalking-ebpf-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/ebpf/provider/handler/ContinuousProfilingServiceHandler.java b/oap-server/server-receiver-plugin/skywalking-ebpf-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/ebpf/provider/handler/ContinuousProfilingServiceHandler.java index a3eb99e280..119975b04a 100644 --- a/oap-server/server-receiver-plugin/skywalking-ebpf-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/ebpf/provider/handler/ContinuousProfilingServiceHandler.java +++ b/oap-server/server-receiver-plugin/skywalking-ebpf-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/ebpf/provider/handler/ContinuousProfilingServiceHandler.java @@ -112,6 +112,12 @@ public class ContinuousProfilingServiceHandler extends ContinuousProfilingServic } } + // if no service need to check from DB then return empty + if (serviceIdList.isEmpty()) { + sendEmptyCommands(responseObserver); + return; + } + // query the policies which not in the cache final List queriedFromDB = policyDAO.queryPolicies(serviceIdList); for (ContinuousProfilingPolicy dbPolicy : queriedFromDB) { @@ -294,4 +300,4 @@ public class ContinuousProfilingServiceHandler extends ContinuousProfilingServic private static class PolicyWrapper { final ContinuousProfilingPolicy policy; } -} \ No newline at end of file +}