looks like lock tables don't return the tables locked

This commit is contained in:
Alex Huang 2011-08-02 02:10:47 -07:00
parent 6905a1db1d
commit 91550836cf
2 changed files with 7 additions and 10 deletions

View File

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

View File

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