mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
looks like lock tables don't return the tables locked
This commit is contained in:
parent
6905a1db1d
commit
91550836cf
@ -385,10 +385,6 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
|
||||
try {
|
||||
PreparedStatement pstmt = txn.prepareAutoCloseStatement("LOCK TABLES op_vm_ruleset_log WRITE, op_nwgrp_work WRITE");
|
||||
int tablesLocked = pstmt.executeUpdate();
|
||||
if (tablesLocked != 2) {
|
||||
s_logger.warn("Unable to get locks on both tables: " + tablesLocked);
|
||||
return;
|
||||
}
|
||||
for (Long vmId : affectedVms) {
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Security Group Mgr: scheduling ruleset updates for " + vmId);
|
||||
@ -427,7 +423,6 @@ public class SecurityGroupManagerImpl implements SecurityGroupManager, SecurityG
|
||||
try {
|
||||
PreparedStatement pstmt = txn.prepareAutoCloseStatement("UNLOCK TABLES");
|
||||
int tablesUnlocked = pstmt.executeUpdate();
|
||||
assert (tablesUnlocked == 2) : "Less than two tables unlocked: " + tablesUnlocked;
|
||||
} catch (SQLException e) {
|
||||
s_logger.warn("Unable to unlock tables");
|
||||
}
|
||||
|
||||
@ -1728,11 +1728,13 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
||||
@Override
|
||||
public boolean processAnswers(long agentId, long seq, Answer[] answers) {
|
||||
for (final Answer answer : answers) {
|
||||
if (!answer.getResult()) {
|
||||
s_logger.warn("Cleanup failed due to " + answer.getDetails());
|
||||
} else {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Cleanup succeeded. Details " + answer.getDetails());
|
||||
if (answer.getClass() == StopAnswer.class) {
|
||||
if (!answer.getResult()) {
|
||||
s_logger.warn("Cleanup failed due to " + answer.getDetails());
|
||||
} else {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Cleanup succeeded. Details " + answer.getDetails());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user