Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.8' into 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 4, 2017
2 parents 9d7799c + 4cad934 commit 9c2a7cf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,10 @@ protected OutgoingBatch extractOutgoingBatch(ProcessInfo processInfo, Node targe
}
throw ex;
} finally {
IStagedResource resource = getStagedResource(currentBatch);
if (resource != null) {
resource.setState(State.DONE);
}
lock.release();
synchronized (locks) {
locks.remove(semaphoreKey);
Expand Down Expand Up @@ -1195,8 +1199,10 @@ protected void transferFromStaging(ExtractMode mode, BatchType batchType, Outgoi
} catch (Throwable t) {
throw new RuntimeException(t);
} finally {
stagedResource.setState(State.DONE);
stagedResource.close();
if (!stagedResource.isFileResource()) {
stagedResource.delete();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,9 @@ protected IDataWriter chooseDataWriter(Batch batch) {
}
}
resource.setState(State.DONE);
if (!resource.isFileResource()) {
resource.delete();
}
}
} else {
log.info("The batch {} was missing in staging. Setting status to resend", batch.getNodeBatchId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ public void process() throws IOException {
} else if (line.startsWith(CsvConstants.CHANNEL)) {
channelLine = line;
} else {
if (writer == null) {
throw new IllegalStateException("Invalid batch data was received: " + line);
}
TableLine batchLine = batchTableLines.get(tableLine);
if (batchLine == null || (batchLine != null && batchLine.columnsLine == null)) {
TableLine syncLine = syncTableLines.get(tableLine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ public void close() {
closeInternal();
if (isFileResource()) {
stagingManager.inUse.remove(path);
} else if (state == State.DONE) {
deleteInternal();
}
}
}

private void closeInternal() {
Expand Down Expand Up @@ -330,7 +328,6 @@ private boolean deleteInternal() {
}

if (memoryBuffer != null) {
memoryBuffer.setLength(0);
memoryBuffer = null;
deleted = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public void handle(HttpServletRequest req, HttpServletResponse res) throws IOExc
log.info("Configuration request from node ID " + remoteNode.getNodeId() + " {symmetricVersion={}, configVersion={}}",
symVersion, configVersion);

// TODO
//if (StringUtils.isBlank(configVersion) || Version.isOlderThanVersion(configVersion, Version.version())) {
if (StringUtils.isBlank(configVersion) || Version.isOlderThanVersion(configVersion, "3.8.22")) {
if (StringUtils.isBlank(configVersion) || Version.isOlderThanVersion(configVersion, Version.version())) {
OutputStream outputStream = res.getOutputStream();
dataExtractorService.extractConfigurationStandalone(remoteNode, outputStream);
}
Expand Down

0 comments on commit 9c2a7cf

Please sign in to comment.