accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-3555) TabletServerBatchReaderIterator doesn't maintain reference to TabletServerBatchReader
Date Tue, 03 Feb 2015 00:35:34 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14302562#comment-14302562
] 

Josh Elser commented on ACCUMULO-3555:
--------------------------------------

Talked to [~bills] about this. He remembered that he often ran into this when writing simple,
standalone programs in which the JVM was short lived. He intentionally didn't bother closing
the BatchScanner because he knew that the JVM was going to exit anyways, which could cause
his application to error unexpectedly.

I'm not sure if we want to cater to that case (we know that users are doing the "wrong" thing).
If we make the "back-reference" from TSBRI to TSBR, we would keep the error from happening
as quickly, but it would cause the (I'm guessing) common case of forgetting to close the BatchScanner
occur less frequently. I'm not sure if that would be an improvement or not.

Thoughts? My gut reaction is to standardize on how we expect the API to be used (don't make
any changes), and avoid allowing willful negligence since it could reduce the likelihood the
error is thrown during unwitting negligence.



> 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)

Mime
View raw message