mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 10920: avoid deadlocks by avoiding locks on the index on step
This commit is contained in:
parent
f48efae77c
commit
b4b87b1de8
@ -1140,6 +1140,8 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
|
||||
Set<Long> affectedVms = new HashSet<Long>();
|
||||
for (SecurityGroupWorkVO work : unfinished) {
|
||||
affectedVms.add(work.getInstanceId());
|
||||
work.setStep(Step.Error);
|
||||
_workDao.update(work.getId(), work);
|
||||
}
|
||||
scheduleRulesetUpdateToHosts(affectedVms, false, null);
|
||||
} else {
|
||||
|
||||
@ -41,6 +41,9 @@ public interface SecurityGroupWorkDao extends GenericDao<SecurityGroupWorkVO, Lo
|
||||
|
||||
List<SecurityGroupWorkVO> findUnfinishedWork(Date timeBefore);
|
||||
|
||||
List<SecurityGroupWorkVO> findAndCleanupUnfinishedWork(Date timeBefore);
|
||||
|
||||
|
||||
List<SecurityGroupWorkVO> findScheduledWork();
|
||||
|
||||
|
||||
|
||||
@ -210,13 +210,24 @@ public class SecurityGroupWorkDaoImpl extends GenericDaoBase<SecurityGroupWorkVO
|
||||
|
||||
List<SecurityGroupWorkVO> result = listIncludingRemovedBy(sc);
|
||||
|
||||
SecurityGroupWorkVO work = createForUpdate();
|
||||
work.setStep(Step.Error);
|
||||
update(work, sc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SecurityGroupWorkVO> findAndCleanupUnfinishedWork(Date timeBefore) {
|
||||
final SearchCriteria<SecurityGroupWorkVO> sc = CleanupSearch.create();
|
||||
sc.setParameters("taken", timeBefore);
|
||||
sc.setParameters("step", Step.Processing);
|
||||
|
||||
List<SecurityGroupWorkVO> result = listIncludingRemovedBy(sc);
|
||||
|
||||
SecurityGroupWorkVO work = createForUpdate();
|
||||
work.setStep(Step.Error);
|
||||
update(work, sc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SecurityGroupWorkVO> findScheduledWork() {
|
||||
final SearchCriteria<SecurityGroupWorkVO> sc = UntakenWorkSearch.create();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user