Skip to content

Commit

Permalink
0001921: While sending a batch, if a batch is set to IG and an error …
Browse files Browse the repository at this point in the history
…occurs, then the batch gets set to ER and the IG status is ignored
  • Loading branch information
chenson42 committed Aug 16, 2014
1 parent 9d9d4b9 commit f28f5ab
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -542,6 +542,9 @@ protected List<OutgoingBatch> extract(ProcessInfo processInfo, Node targetNode,
} catch (RuntimeException e) {
SQLException se = unwrapSqlException(e);
if (currentBatch != null) {
/* Reread batch in case the ignore flag has been set */
currentBatch = outgoingBatchService.
findOutgoingBatch(currentBatch.getBatchId(), currentBatch.getNodeId());
statisticManager.incrementDataExtractedErrors(currentBatch.getChannelId(), 1);
if (se != null) {
currentBatch.setSqlState(se.getSQLState());
Expand All @@ -551,10 +554,11 @@ protected List<OutgoingBatch> extract(ProcessInfo processInfo, Node targetNode,
currentBatch.setSqlMessage(getRootMessage(e));
}
currentBatch.revertStatsOnError();
if (currentBatch.getStatus() != Status.IG) {
if (currentBatch.getStatus() != Status.IG &&
currentBatch.getStatus() != Status.OK) {
currentBatch.setStatus(Status.ER);
currentBatch.setErrorFlag(true);
}
currentBatch.setErrorFlag(true);
outgoingBatchService.updateOutgoingBatch(currentBatch);

if (isStreamClosedByClient(e)) {
Expand Down

0 comments on commit f28f5ab

Please sign in to comment.