accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/6] accumulo git commit: ACCUMULO-3556 Improve "scanner closed" error message.
Date Mon, 02 Feb 2015 23:14:30 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.5 8b54f13fd -> 4e8471a3f
  refs/heads/1.6 c5d2bd54a -> 4999b5a23
  refs/heads/master a6a2be8aa -> d7dcb8773


ACCUMULO-3556 Improve "scanner closed" error message.

When a client sees a "scanner closed" exception come out
of the BatchScanner impl, it is not intuitive that the
problem is within their code and not in Accumulo itself.
Provide a strong error message to inform the user that the
problem is in their code and not an Accumulo bug.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4e8471a3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4e8471a3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4e8471a3

Branch: refs/heads/1.5
Commit: 4e8471a3fa115083f9e930b92388150a8095846a
Parents: 8b54f13
Author: Josh Elser <elserj@apache.org>
Authored: Mon Feb 2 18:08:39 2015 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Feb 2 18:08:39 2015 -0500

----------------------------------------------------------------------
 .../core/client/impl/TabletServerBatchReaderIterator.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4e8471a3/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
index 894616e..b23008e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
@@ -208,8 +208,12 @@ public class TabletServerBatchReaderIterator implements Iterator<Entry<Key,Value
           else
             throw new RuntimeException(fatalException);
 
-        if (queryThreadPool.isShutdown())
-          throw new RuntimeException("scanner closed");
+        if (queryThreadPool.isShutdown()) {
+          String shortMsg = "The BatchScanner was unexpectedly closed while this Iterator
was still in use.";
+          log.error(shortMsg + " Ensure that a reference to the BatchScanner is retained
so that it can be closed when this Iterator is exhausted."
+              + " Not retaining a reference to the BatchScanner guarantees that you are leaking
threads in your client JVM.");
+          throw new RuntimeException(shortMsg + " Ensure proper handling of the BatchScanner.");
+        }
 
         batchIterator = batch.iterator();
         return batch != LAST_BATCH;


Mime
View raw message