Skip to content

Commit

Permalink
0003748: Batch was not complete
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jan 11, 2019
1 parent 662c068 commit 7348dc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Expand Up @@ -848,7 +848,7 @@ protected List<OutgoingBatch> extract(final ProcessInfo extractInfo, final Node
} else if (e instanceof StagingLowFreeSpace) {
log.error("Extract is disabled because disk is almost full: {}", e.getMessage());
} else if (e.getCause() instanceof ZipException) {
log.info("The batch {} appears corrupt in staging, so removing it. ({})", currentBatch.getNodeBatchId(), e.getMessage());
log.warn("The batch {} appears corrupt in staging, so removing it. ({})", currentBatch.getNodeBatchId(), e.getMessage());
IStagedResource extractedBatch = getStagedResource(currentBatch);
if (extractedBatch != null) {
extractedBatch.delete();
Expand Down
Expand Up @@ -51,6 +51,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.zip.ZipException;

import org.apache.commons.lang.StringUtils;
import org.jumpmind.db.model.Table;
Expand Down Expand Up @@ -1096,17 +1097,20 @@ protected IDataWriter chooseDataWriter(Batch batch) {
throw e;
}
} else {
if (e instanceof ParseException || e instanceof ProtocolException) {
log.info("The batch {} may be corrupt in staging, so removing it.", batchInStaging.getNodeBatchId());
isError = true;
if (e instanceof ParseException || e instanceof ProtocolException || e.getCause() instanceof ZipException) {
log.warn("The batch {} may be corrupt in staging, so removing it.", batchInStaging.getNodeBatchId());
resource.delete();
incomingBatch = listener.currentBatch;
incomingBatch.setStatus(Status.ER);
incomingBatch.setSqlCode(ErrorConstants.PROTOCOL_VIOLATION_CODE);
incomingBatch.setSqlState(ErrorConstants.PROTOCOL_VIOLATION_STATE);
incomingBatchService.updateIncomingBatch(incomingBatch);
if (incomingBatch != null) {
incomingBatch.setStatus(Status.ER);
incomingBatch.setSqlCode(ErrorConstants.PROTOCOL_VIOLATION_CODE);
incomingBatch.setSqlState(ErrorConstants.PROTOCOL_VIOLATION_STATE);
incomingBatchService.updateIncomingBatch(incomingBatch);
}
} else {
throw e;
}
isError = true;
throw e;
}
} finally {
incomingBatch = listener.currentBatch;
Expand Down

0 comments on commit 7348dc2

Please sign in to comment.