bug 10497: always execute next command in sequence, even when the current one fails to complete; otherwise all the remaining commands will be stuck in the queue forever

status 10497: resolved fixed
This commit is contained in:
alena 2011-06-29 14:13:14 -07:00
parent c8c84af109
commit 13f67a3d56
1 changed files with 26 additions and 21 deletions

View File

@ -268,31 +268,36 @@ public abstract class AgentAttache {
boolean processed = false;
Listener monitor = getListener(seq);
try {
Listener monitor = getListener(seq);
if (monitor == null) {
if ( answers[0] != null && answers[0].getResult() ) {
processed = true;
}
if (s_logger.isDebugEnabled()) {
s_logger.debug(log(seq, "Unable to find listener."));
}
} else {
processed = monitor.processAnswers(_id, seq, answers);
if (s_logger.isTraceEnabled()) {
s_logger.trace(log(seq, (processed ? "" : " did not ") + " processed "));
}
if (monitor == null) {
if ( answers[0] != null && answers[0].getResult() ) {
processed = true;
}
if (s_logger.isDebugEnabled()) {
s_logger.debug(log(seq, "Unable to find listener."));
}
} else {
processed = monitor.processAnswers(_id, seq, answers);
if (s_logger.isTraceEnabled()) {
s_logger.trace(log(seq, (processed ? "" : " did not ") + " processed "));
}
if (!monitor.isRecurring()) {
unregisterListener(seq);
if (!monitor.isRecurring()) {
unregisterListener(seq);
}
}
_agentMgr.notifyAnswersToMonitors(_id, seq, answers);
} finally {
// we should always trigger next command execution, even in failure cases - otherwise in exception case all the remaining will be stuck in the sync queue forever
if (resp.executeInSequence()) {
sendNext(seq);
}
}
if (resp.executeInSequence()) {
sendNext(seq);
}
_agentMgr.notifyAnswersToMonitors(_id, seq, answers);
return processed;
}