diff --git a/CHANGELOG.md b/CHANGELOG.md index b226595b2e..7853a853d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Remove explicit unused Scaffeine dependency from projects [#3314](https://github.com/locationtech/geotrellis/pull/3314) +- Remove an excessive close after the abort call in S3RangeReader [#3324](https://github.com/locationtech/geotrellis/pull/3324) ## [3.5.1] - 2020-11-23 diff --git a/README.md b/README.md index a9763f57cb..be1285a04e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ GeoTrellis is currently available for Scala 2.11 and 2.12, using Spark 2.4.x. To get started with SBT, simply add the following to your build.sbt file: ```scala -libraryDependencies += "org.locationtech.geotrellis" %% "geotrellis-raster" % "3.0.0" +libraryDependencies += "org.locationtech.geotrellis" %% "geotrellis-raster" % "" ``` To grab the latest `SNAPSHOT`, `RC` or milestone build, add these resolvers: diff --git a/s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala b/s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala index 00cf34a144..aa80e108da 100644 --- a/s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala +++ b/s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala @@ -55,8 +55,19 @@ class S3RangeReader( val responseStream = client.getObject(request) val length = responseStream.response.contentLength + /** + * The response stream is backed by [[org.apache.http.conn.EofSensorInputStream]]. + * There is no need in closing the stream via close() after calling abort(). + * + * abort() is a special version of close() which prevents + * re-use of the underlying connection, if any. Calling this method + * indicates that there should be no attempt to read until the end of + * the stream. + * * throws IOException in case of an IO problem on closing the underlying stream + * + * Source: https://github.com/apache/httpcomponents-core/blob/5.2.x/httpcore5/src/main/java/org/apache/hc/core5/http/io/EofSensorInputStream.java#L269-L283 + */ responseStream.abort() - responseStream.close() length } }