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:
Koushik Das 2015-04-29 11:10:48 +05:30 committed by Rohit Yadav
parent 27b7e49b39
commit 6378d37c5e
3 changed files with 3 additions and 4 deletions

View File

@ -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;
}

View File

@ -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 {

View File

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