nichunen commented on a change in pull request #973: [KYLIN-4165] Fix RT OLAP 
building job on "Save Cube Dictionaries" step concurrency error
URL: https://github.com/apache/kylin/pull/973#discussion_r353563733
 
 

 ##########
 File path: 
server-base/src/main/java/org/apache/kylin/rest/service/JobService.java
 ##########
 @@ -638,6 +640,23 @@ public void cancelJob(JobInstance job) throws IOException 
{
             AbstractExecutable executable = 
getExecutableManager().getJob(job.getId());
             if (executable instanceof CubingJob) {
                 cancelCubingJobInner((CubingJob) executable);
+                //release global mr hive dict lock if exists
+                if (executable.getStatus().isFinalState()) {
+                    try {
+                        DistributedLock lock = 
KylinConfig.getInstanceFromEnv().getDistributedLockFactory().lockForCurrentThread();
+                        
if(lock.isLocked(CubeJobLockUtil.getLockPath(executable.getCubeName(), 
job.getId()))){//release cube job dict lock if exists
+                            
lock.purgeLocks(CubeJobLockUtil.getLockPath(executable.getCubeName(), null));
 
 Review comment:
   Why purge all locks here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to