Skip to content

Revert ConcurrencyLimiter to a chunkd SourceMiddleware once chunkd forwards the abort signal #565

@kylebarron

Description

@kylebarron

Written by Claude on behalf of @kylebarron

Summary

GeoTIFF.fromUrl gates network reads through the ConcurrencyLimiter by wrapping the source (LimitedSource in packages/geotiff/src/limiter.ts) and composing SourceChunk / SourceCache on top of it. This is a workaround: the natural design is a chunkd SourceMiddleware (composes directly with the other middleware), but chunkd's SourceView does not forward the request signal to middleware, so a middleware can't observe an abort — only the underlying source receives the read options (incl. signal) via SourceView's terminal handler.

Upstream fix: blacha/chunkd#1697

When that ships and we bump @chunkd/source

Revert LimitedSource back to a SourceMiddleware (LimiterMiddleware) and compose it into the header SourceView after SourceChunk / SourceCache (so cache hits still short-circuit). The pre-workaround implementation is in git history (commit before this issue's fix) — git show the LimiterMiddleware class in packages/geotiff/src/limiter.ts and the fromUrl composition in packages/geotiff/src/geotiff.ts.

This is an internal-only change — the public API (GeoTIFF.fromUrl options, ConcurrencyLimiter, Priority, PerOriginSemaphore) does not change either way.

Bonus (also fixed by #1697)

chunkd's SourceChunk.fetchChunks dropped the signal on multi-chunk sub-requests; #1697 forwards it. Until released, multi-chunk header reads gate without a signal (rare — header tags are small/single-chunk).

Context: split out of #557.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions