mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02: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.
This commit is contained in:
parent
0b8355920e
commit
6dfb8ab03e
@ -116,9 +116,9 @@ public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO, Long>
|
|||||||
l.add(item);
|
l.add(item);
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
s_logger.error("Unexpected sql excetpion, ", e);
|
s_logger.error("Unexpected sql exception, ", e);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
s_logger.error("Unexpected excetpion, ", e);
|
s_logger.error("Unexpected exception, ", e);
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -554,7 +554,6 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
|
|||||||
if (job.getSyncSource() != null) {
|
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
|
// 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());
|
_queueMgr.purgeItem(job.getSyncSource().getId());
|
||||||
checkQueue(job.getSyncSource().getQueueId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -160,7 +160,7 @@ public class SyncQueueManagerImpl extends ManagerBase implements SyncQueueManage
|
|||||||
itemVO.setLastProcessTime(dt);
|
itemVO.setLastProcessTime(dt);
|
||||||
_syncQueueItemDao.update(item.getId(), itemVO);
|
_syncQueueItemDao.update(item.getId(), itemVO);
|
||||||
|
|
||||||
resultList.add(item);
|
resultList.add(itemVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user