Skip to content

Commit 6dfb8ab

Browse files
committed
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.
1 parent 0b83559 commit 6dfb8ab

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ public List<SyncQueueItemVO> getNextQueueItems(int maxItems) {
116116
l.add(item);
117117
}
118118
} catch (SQLException e) {
119-
s_logger.error("Unexpected sql excetpion, ", e);
119+
s_logger.error("Unexpected sql exception, ", e);
120120
} catch (Throwable e) {
121-
s_logger.error("Unexpected excetpion, ", e);
121+
s_logger.error("Unexpected exception, ", e);
122122
}
123123
return l;
124124
}

framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ protected void runInContext() {
554554
if (job.getSyncSource() != null) {
555555
// here check queue item one more time to double make sure that queue item is removed in case of any uncaught exception
556556
_queueMgr.purgeItem(job.getSyncSource().getId());
557-
checkQueue(job.getSyncSource().getQueueId());
558557
}
559558

560559
try {

framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/SyncQueueManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
160160
itemVO.setLastProcessTime(dt);
161161
_syncQueueItemDao.update(item.getId(), itemVO);
162162

163-
resultList.add(item);
163+
resultList.add(itemVO);
164164
}
165165
}
166166
}

0 commit comments

Comments
 (0)