mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8425: Job framework: Same internal job can execute simultaneously
The same internal job was simultaneously getting executed by 2 worked threads. The fix is to ensure that job gets scheduled for execution from a single place. (cherry picked from commit 6dfb8ab03ed05747941a89b4079ff23d25f4d8fd) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
27b7e49b39
commit
6378d37c5e
@ -116,9 +116,9 @@ public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO, Long>
|
||||
l.add(item);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
s_logger.error("Unexpected sql excetpion, ", e);
|
||||
s_logger.error("Unexpected sql exception, ", e);
|
||||
} catch (Throwable e) {
|
||||
s_logger.error("Unexpected excetpion, ", e);
|
||||
s_logger.error("Unexpected exception, ", e);
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
@ -554,7 +554,6 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
|
||||
if (job.getSyncSource() != null) {
|
||||
// here check queue item one more time to double make sure that queue item is removed in case of any uncaught exception
|
||||
_queueMgr.purgeItem(job.getSyncSource().getId());
|
||||
checkQueue(job.getSyncSource().getQueueId());
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@ -160,7 +160,7 @@ public class SyncQueueManagerImpl extends ManagerBase implements SyncQueueManage
|
||||
itemVO.setLastProcessTime(dt);
|
||||
_syncQueueItemDao.update(item.getId(), itemVO);
|
||||
|
||||
resultList.add(item);
|
||||
resultList.add(itemVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user