You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/04/21 10:59:36 UTC

[skywalking] branch master updated: fix cache update timer exception when disable profile in the backend (#4682)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 7de392a  fix cache update timer exception when disable profile in the backend (#4682)
7de392a is described below

commit 7de392af65e90df6457e3afbf6eac7393e2d0dc4
Author: mrproliu <74...@qq.com>
AuthorDate: Tue Apr 21 18:59:17 2020 +0800

    fix cache update timer exception when disable profile in the backend (#4682)
    
    * fix cache update timer exception when disable profile in the backend
    
    * add comment
    
    Co-authored-by: Mrproliu <mr...@lagou.com>
    Co-authored-by: 吴晟 Wu Sheng <wu...@foxmail.com>
---
 .../apache/skywalking/oap/server/core/cache/CacheUpdateTimer.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/CacheUpdateTimer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/CacheUpdateTimer.java
index 1a3033a..fb0e487 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/CacheUpdateTimer.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/CacheUpdateTimer.java
@@ -26,8 +26,10 @@ import java.util.stream.Collectors;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
 import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.analysis.DisableRegister;
 import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
 import org.apache.skywalking.oap.server.core.analysis.manual.networkalias.NetworkAddressAlias;
+import org.apache.skywalking.oap.server.core.profile.ProfileTaskRecord;
 import org.apache.skywalking.oap.server.core.query.type.ProfileTask;
 import org.apache.skywalking.oap.server.core.storage.StorageModule;
 import org.apache.skywalking.oap.server.core.storage.cache.INetworkAddressAliasDAO;
@@ -55,7 +57,10 @@ public enum CacheUpdateTimer {
 
     private void update(ModuleDefineHolder moduleDefineHolder) {
         updateNetAddressAliasCache(moduleDefineHolder);
-        updateProfileTask(moduleDefineHolder);
+        // Profile could be disabled by the OAL script. Only load the task when it is activated.
+        if (!DisableRegister.INSTANCE.include(ProfileTaskRecord.INDEX_NAME)) {
+            updateProfileTask(moduleDefineHolder);
+        }
     }
 
     /**