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 <mrproliu@lagou.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
mrproliu 2020-04-21 18:59:17 +08:00 committed by GitHub
parent 7d1fdd3ea8
commit 7de392af65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}
}
/**