Repository: flink Updated Branches: refs/heads/master da8c02b91 -> 1b40386d3
[FLINK-1545] [runtime][tests] Fixes AsynchronousFileIOChannelsTest.testExceptionForwardsToClose by introducing additional error check in AsynchronousFileIOChannel.close method This closes #399 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/81a7837a Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/81a7837a Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/81a7837a Branch: refs/heads/master Commit: 81a7837a942668c23c795e5bd8a68c4d17009f85 Parents: da8c02b Author: Till Rohrmann <trohrm...@apache.org> Authored: Sat Feb 14 16:33:35 2015 +0100 Committer: Stephan Ewen <se...@apache.org> Committed: Sun Feb 15 18:30:11 2015 +0100 ---------------------------------------------------------------------- .../runtime/io/disk/iomanager/AsynchronousFileIOChannel.java | 5 ++++- .../io/disk/iomanager/AsynchronousFileIOChannelsTest.java | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/81a7837a/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java index 281eaad..8889f70 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannel.java @@ -48,7 +48,7 @@ public abstract class AsynchronousFileIOChannel<T, R extends IORequest> extends /** An atomic integer that counts the number of requests that we still wait for to return. */ protected final AtomicInteger requestsNotReturned = new AtomicInteger(0); - /** Hander for completed requests */ + /** Handler for completed requests */ protected final RequestDoneCallback<T> resultHandler; /** An exception that was encountered by the asynchronous request handling thread.*/ @@ -117,6 +117,9 @@ public abstract class AsynchronousFileIOChannel<T, R extends IORequest> extends throw new IOException("Closing of asynchronous file channel was interrupted."); } } + + // Additional check because we might have skipped the while loop + checkErroneous(); } finally { // close the file http://git-wip-us.apache.org/repos/asf/flink/blob/81a7837a/flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannelsTest.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannelsTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannelsTest.java index 94409a4..0ed6233 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannelsTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/disk/iomanager/AsynchronousFileIOChannelsTest.java @@ -92,8 +92,7 @@ public class AsynchronousFileIOChannelsTest { testExceptionForwardsToClose(ioMan, 100, 1); testExceptionForwardsToClose(ioMan, 100, 50); testExceptionForwardsToClose(ioMan, 100, 100); - } - finally { + } finally { ioMan.shutdown(); } }