feat: remove close, sources should auto close themselves#1663
Merged
Conversation
|
I'm a fan of this. I suppose it's only the case where you have thousands of potential files and you don't want to actually open one until necessary, that this gets a little messy. |
blacha
pushed a commit
that referenced
this pull request
Mar 24, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>fs: 11.4.0</summary> ## [11.4.0](fs-v11.3.2...fs-v11.4.0) (2026-03-21) ### Features * **fs:** support providing credentials for both read and read-write ([#1319](#1319)) ([1307d99](1307d99)) * support more write options ([#1661](#1661)) ([bba1d3c](bba1d3c)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 * @chunkd/source-memory bumped from ^11.0.3 to ^11.1.0 * @chunkd/source-file bumped from ^11.0.2 to ^11.1.0 * @chunkd/source-http bumped from ^11.2.0 to ^11.3.0 </details> <details><summary>fs-aws: 11.5.0</summary> ## [11.5.0](fs-aws-v11.4.2...fs-aws-v11.5.0) (2026-03-21) ### Features * **fs:** support providing credentials for both read and read-write ([#1319](#1319)) ([1307d99](1307d99)) * support more write options ([#1661](#1661)) ([bba1d3c](bba1d3c)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/fs bumped from 11.3.2 to 11.4.0 * @chunkd/source-aws bumped from 11.0.5 to 11.1.0 </details> <details><summary>middleware: 11.2.1</summary> ## [11.2.1](middleware-v11.2.0...middleware-v11.2.1) (2026-03-21) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 </details> <details><summary>source: 11.3.0</summary> ## [11.3.0](source-v11.2.0...source-v11.3.0) (2026-03-21) ### Features * remove close, sources should auto close themselves ([#1663](#1663)) ([f9fde92](f9fde92)) * support more write options ([#1661](#1661)) ([bba1d3c](bba1d3c)) </details> <details><summary>source-aws: 11.1.0</summary> ## [11.1.0](source-aws-v11.0.5...source-aws-v11.1.0) (2026-03-21) ### Features * support more write options ([#1661](#1661)) ([bba1d3c](bba1d3c)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 </details> <details><summary>source-file: 11.1.0</summary> ## [11.1.0](source-file-v11.0.2...source-file-v11.1.0) (2026-03-21) ### Features * limits reads to the maximum size of the source ([#1666](#1666)) ([239855b](239855b)) * remove close, sources should auto close themselves ([#1663](#1663)) ([f9fde92](f9fde92)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 </details> <details><summary>source-http: 11.3.0</summary> ## [11.3.0](source-http-v11.2.0...source-http-v11.3.0) (2026-03-21) ### Features * support more write options ([#1661](#1661)) ([bba1d3c](bba1d3c)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 </details> <details><summary>source-memory: 11.1.0</summary> ## [11.1.0](source-memory-v11.0.3...source-memory-v11.1.0) (2026-03-21) ### Features * limits reads to the maximum size of the source ([#1666](#1666)) ([239855b](239855b)) ### Dependencies * The following workspace dependencies were updated * dependencies * @chunkd/source bumped from ^11.2.0 to ^11.3.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motiviation
the file closing logic has been a annoyance for consumers needing to remember to close tiffs is hard, the file handle is often kept open for very long times and not read frequently and the closing logic has now leaked into the middleware
Modifcation
open -> read -> closeper fetch, this behaviour is reasonably similar in terms of raw performance unless there are 1000s of readsVerification
Unit tests.
ref: blacha/cogeotiff#1446