Updated Branches: refs/heads/1.5.1-SNAPSHOT 52ef7c6e0 -> 1f99e6e14 refs/heads/1.6.0-SNAPSHOT 71b2baec7 -> 420d7db3b refs/heads/master ba9bfa938 -> 0d7312e32
ACCUMULO-1998 Defense against concurrent write() and close() by relying on DfsLogger output stream interaction Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cac60938 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cac60938 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cac60938 Branch: refs/heads/master Commit: cac60938f08a1ce40bbbc0e89c2d01ee8350fd1a Parents: 8ead5c6 Author: John Vines <vi...@apache.org> Authored: Thu Jan 16 16:03:35 2014 -0500 Committer: John Vines <vi...@apache.org> Committed: Fri Jan 17 15:54:28 2014 -0500 ---------------------------------------------------------------------- .../apache/accumulo/core/security/crypto/BlockedOutputStream.java | 2 +- .../src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/cac60938/core/src/main/java/org/apache/accumulo/core/security/crypto/BlockedOutputStream.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/BlockedOutputStream.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/BlockedOutputStream.java index 1f3cf3b..ca72055 100644 --- a/core/src/main/java/org/apache/accumulo/core/security/crypto/BlockedOutputStream.java +++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/BlockedOutputStream.java @@ -55,7 +55,7 @@ public class BlockedOutputStream extends OutputStream { remainder = blockSize - remainder; // This is garbage - bb.position(bb.position() + remainder); + bb.position(size + remainder); out.write(bb.array(), 0, size + remainder); out.flush(); http://git-wip-us.apache.org/repos/asf/accumulo/blob/cac60938/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java index 3074614..e80cd15 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java @@ -440,7 +440,7 @@ public class DfsLogger { if (encryptingLogFile != null) try { - encryptingLogFile.close(); + logFile.close(); } catch (IOException ex) { log.error(ex); throw new LogClosedException();