Skip to content
Permalink
Browse files

0001749: Incoming ProcessInfo is not marked as ERROR when a batch ERR…

…OR occurs. It is marked as OK.
  • Loading branch information...
chenson42 committed Jun 6, 2014
1 parent 896614e commit afdadade71c70c94ea3059e444abc247a5a869fc
@@ -216,6 +216,7 @@ public void addDataLoaderFactory(IDataLoaderFactory factory) {
processInfo.setStatus(ProcessInfo.Status.OK);
return list;
} catch (IOException ex) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
throw new IoException();
} catch (RuntimeException ex) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
@@ -285,7 +286,12 @@ public void loadDataFromPull(Node remote, RemoteNodeStatus status) throws IOExce
sendAck(remote, local, localSecurity, list, transportManager);
}
}
processInfo.setStatus(ProcessInfo.Status.OK);

if (containsError(list)) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
} else {
processInfo.setStatus(ProcessInfo.Status.OK);
}
} catch (RuntimeException e) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
throw e;
@@ -315,6 +321,15 @@ public void loadDataFromPull(Node remote, RemoteNodeStatus status) throws IOExce
}
}

private boolean containsError(List<IncomingBatch> list) {
for (IncomingBatch incomingBatch : list) {
if (incomingBatch.getStatus() == Status.ER) {
return true;
}
}
return false;
}

/**
* Load database from input stream and write acknowledgment to output
* stream. This is used for a "push" request with a response of an
@@ -333,7 +348,11 @@ public void loadDataFromPush(Node sourceNode, InputStream in, OutputStream out)
processInfo.setStatus(ProcessInfo.Status.ACKING);
transportManager.writeAcknowledgement(out, sourceNode, list, local,
security != null ? security.getNodePassword() : null);
processInfo.setStatus(ProcessInfo.Status.OK);
if (containsError(list)) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
} else {
processInfo.setStatus(ProcessInfo.Status.OK);
}
} catch (RuntimeException e) {
processInfo.setStatus(ProcessInfo.Status.ERROR);
throw e;

0 comments on commit afdadad

Please sign in to comment.
You can’t perform that action at this time.