[ 
https://issues.apache.org/jira/browse/KYLIN-5762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17831147#comment-17831147
 ] 

pengfei.zhan commented on KYLIN-5762:
-------------------------------------

h1. Root Cause

The parameter `kylin.job.max-concurrent-jobs ` can be set to 0. For example:
The value of this parameter was not 0 when KYLIN was started. Later, the user 
created a batch of tasks, but the user did not want these tasks to be 
scheduled, so the value of this parameter was modified to 0 in the project 
parameter setting module. Next, maybe due to some problems, the user restarts 
the KYLIN system and finds the system scheduled task scheduling is abnormal.

When restarting the KYLIN, the core pool size is 0, creating jobPool throws 
IllegalArgumentException for the
maximumPoolSize can not be 0. Due to the initialization of Job scheduler 
failed, the ExecutableContext is null. When scheduling tasks, both the jobPool 
and the executableContext  are null, the NPE throws.
 
{code:java}
// job scheduler corePoolSize
int corePoolSize = getMaxConcurrentJobLimitByProject(config, jobEngineConfig, 
project); 
jobPool = new ThreadPoolExecutor(corePoolSize, corePoolSize, Long.MAX_VALUE, 
TimeUnit.DAYS,
        new SynchronousQueue<>(), new 
NamedThreadFactory("RunJobWorker(project:" + project + ")"));
context = new ExecutableContext(Maps.newConcurrentMap(), 
Maps.newConcurrentMap(), jobEngineConfig.getConfig(),
        epochId);{code}
On the job page we will find that all tasks are suspended. If we restart these 
tasks, NPE will be thrown. 

 

> Initialize job scheduler encounters NPE
> ---------------------------------------
>
>                 Key: KYLIN-5762
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5762
>             Project: Kylin
>          Issue Type: Bug
>          Components: Job Engine
>    Affects Versions: 5.0-beta
>            Reporter: pengfei.zhan
>            Assignee: pengfei.zhan
>            Priority: Major
>             Fix For: 5.0-beta
>
>
> Given `kylin.job.max-concurrent-jobs=0`, the initialization of job scheduler 
> encounters NPE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to