Fix query continues profiling policies error when the policy is already in the cache (#13155)

This commit is contained in:
mrproliu 2025-03-28 22:26:38 +08:00 committed by GitHub
parent da491cb063
commit 33c0e8e67b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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<ContinuousProfilingPolicy> queriedFromDB = policyDAO.queryPolicies(serviceIdList);
for (ContinuousProfilingPolicy dbPolicy : queriedFromDB) {
@ -294,4 +300,4 @@ public class ContinuousProfilingServiceHandler extends ContinuousProfilingServic
private static class PolicyWrapper {
final ContinuousProfilingPolicy policy;
}
}
}