Skip to content

feat: remove close, sources should auto close themselves#1663

Merged
blacha merged 3 commits intomasterfrom
feat/remove-close
Mar 20, 2026
Merged

feat: remove close, sources should auto close themselves#1663
blacha merged 3 commits intomasterfrom
feat/remove-close

Conversation

@blacha
Copy link
Copy Markdown
Owner

@blacha blacha commented Mar 19, 2026

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

  • SourceFile now open -> read -> close per fetch, this behaviour is reasonably similar in terms of raw performance unless there are 1000s of reads
  • .close() has been removed from all interfaces.

Verification

Unit tests.

ref: blacha/cogeotiff#1446

@blacha blacha marked this pull request as ready for review March 19, 2026 20:29
@blacha blacha merged commit f9fde92 into master Mar 20, 2026
7 checks passed
@blacha blacha deleted the feat/remove-close branch March 20, 2026 04:59
@github-actions github-actions Bot mentioned this pull request Mar 20, 2026
@kylebarron
Copy link
Copy Markdown

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants