Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SOLR-17629: SQLHandler: remember to close if open fails #3045

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ Bug Fixes
doing distributed search (sharded collections). This could likely occur for fielded parameters such as
f.CASE_SENSITIVE_FIELD.facet.limit=50. (Yue Yu, David Smiley)

* SOLR-17629: If SQLHandler failed to open the underlying stream (e.g. Solr returns an error; could be user/syntax problem),
it needs to close the stream to cleanup resources but wasn't. (David Smiley)

Dependency Upgrades
---------------------
* SOLR-17471: Upgrade Lucene to 9.12.1. (Pierre Salagnac, Christine Poerschke)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.calcite.linq4j.Enumerator;
import org.apache.solr.client.solrj.io.Tuple;
import org.apache.solr.client.solrj.io.stream.TupleStream;
import org.apache.solr.common.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -42,11 +43,11 @@ class SolrEnumerator implements Enumerator<Object> {
* @param fields Fields to get from each Tuple
*/
SolrEnumerator(TupleStream tupleStream, List<Map.Entry<String, Class<?>>> fields) {

this.tupleStream = tupleStream;
try {
this.tupleStream.open();
} catch (IOException e) {
IOUtils.closeQuietly(tupleStream);
throw new RuntimeException(e);
}
this.fields = fields;
Expand Down
Loading