lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Risden (JIRA)" <>
Subject [jira] [Commented] (SOLR-8190) Implement Closeable on TupleStream
Date Thu, 17 Dec 2015 14:58:46 GMT


Kevin Risden commented on SOLR-8190:

So I put more thought into this last night and since TupleStream has an open method it makes
try-with-resources not really applicable. In the case here, it will call close twice as implemented.
try-with-resources can't be pushed into getTuples since try-with-resources doesn't work with
a open method.

Thinking about this brought up the following thoughts:
* What should happen when open is called twice?
* What should happen when close is called twice?
* What should happen when close is called without open being called?
* Are there places in the code where open/close is called without a try/finally? Will that
cause issues?
* Are there places in the code where is called without a related close call?

There are no checks currently to see if a stream has already been opened or closed. This is
what is causing the different NPE exceptions like in SOLR-8191.

For this ticket, I think just implementing Closeable on TupleStream and not changing the tests
is appropriate. The above items should be addressed though. This will make the patch smaller
and the tests can be improved in followup JIRAS.

[~joel.bernstein]/[~gerlowskija] - Thoughts on the above?

> Implement Closeable on TupleStream
> ----------------------------------
>                 Key: SOLR-8190
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>    Affects Versions: Trunk
>            Reporter: Kevin Risden
>            Assignee: Joel Bernstein
>            Priority: Minor
>         Attachments: SOLR-8190.patch, SOLR-8190.patch
> Implementing Closeable on TupleStream provides the ability to use try-with-resources
( in tests
and in practice. This prevents TupleStreams from being left open when there is an error in
the tests.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message