Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 47EF817AD1 for ; Tue, 3 Feb 2015 16:42:08 +0000 (UTC) Received: (qmail 62822 invoked by uid 500); 3 Feb 2015 16:41:35 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 62783 invoked by uid 500); 3 Feb 2015 16:41:35 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 62748 invoked by uid 99); 3 Feb 2015 16:41:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 16:41:34 +0000 Date: Tue, 3 Feb 2015 16:41:34 +0000 (UTC) From: "Dave Marion (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-3555) TabletServerBatchReaderIterator doesn't maintain reference to TabletServerBatchReader MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ACCUMULO-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14303552#comment-14303552 ] Dave Marion commented on ACCUMULO-3555: --------------------------------------- One option might be to mark ScannerBase with the Closeable interface. Then, if the user uses a BatchScanner or Scanner in a try-with-resources statement, they won't have to worry about cleaning it up and can still use it in the manner from my example. In this case, we could modify the examples and javadoc for the BatchScanner to suggest using in a try-with-resources statement, and if the user doesn't do this then they need to maintain a reference to the BatchScanner and close it when they are done with it. > TabletServerBatchReaderIterator doesn't maintain reference to TabletServerBatchReader > ------------------------------------------------------------------------------------- > > Key: ACCUMULO-3555 > URL: https://issues.apache.org/jira/browse/ACCUMULO-3555 > Project: Accumulo > Issue Type: Bug > Components: client > Affects Versions: 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1 > Reporter: Josh Elser > Assignee: Josh Elser > Priority: Blocker > > Had a user in IRC run into this again today upgrading a 1.4 instance to 1.6.0. > ACCUMULO-587 introduced a {{finalize}} implementation into {{TabletServerBatchReader}} in an attempt to close the {{BatchScanner}} when the user might have forgotten to do so themselves. The problem, however, is that the {{TabletServerBatchReaderIterator}} doesn't maintain a reference to the {{TabletServerBatchReader}} (notice how it only uses it to create a new instnace of {{ScannerOptions}} using the copy constructor). > In other words, when the {{TabletServerBatchReaderIterator}} is constructed, it has no references in the object graph to the {{TabletServerBatchReader}} it was created from. This means that if clients don't hold onto the BatchScanner instance, it's possible that it gets closed by the JVM calling {{finalize()}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)