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.
Summary
GeoTIFF.fromUrlgates network reads through theConcurrencyLimiterby wrapping the source (LimitedSourceinpackages/geotiff/src/limiter.ts) and composingSourceChunk/SourceCacheon top of it. This is a workaround: the natural design is a chunkdSourceMiddleware(composes directly with the other middleware), but chunkd'sSourceViewdoes not forward the requestsignalto middleware, so a middleware can't observe an abort — only the underlying source receives the read options (incl.signal) viaSourceView's terminal handler.Upstream fix: blacha/chunkd#1697
When that ships and we bump
@chunkd/sourceRevert
LimitedSourceback to aSourceMiddleware(LimiterMiddleware) and compose it into the headerSourceViewafterSourceChunk/SourceCache(so cache hits still short-circuit). The pre-workaround implementation is in git history (commit before this issue's fix) —git showtheLimiterMiddlewareclass inpackages/geotiff/src/limiter.tsand thefromUrlcomposition inpackages/geotiff/src/geotiff.ts.This is an internal-only change — the public API (
GeoTIFF.fromUrloptions,ConcurrencyLimiter,Priority,PerOriginSemaphore) does not change either way.Bonus (also fixed by #1697)
chunkd's
SourceChunk.fetchChunksdropped 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.