Skip to content

fix(io): use multiprocessing for repack_rasters#731

Open
scottstanie wants to merge 1 commit into
isce-framework:mainfrom
scottstanie:fix-repack-rasters-mp
Open

fix(io): use multiprocessing for repack_rasters#731
scottstanie wants to merge 1 commit into
isce-framework:mainfrom
scottstanie:fix-repack-rasters-mp

Conversation

@scottstanie

Copy link
Copy Markdown
Contributor

Summary

repack_rasters currently repacks files across a thread pool, but rasterio /
GDAL is not thread-safe for concurrent dataset access; on some GDAL builds this
can corrupt output or deadlock.

Change

  • Switch repack_rasters from a thread pool to a process pool.
  • Use ProcessPoolExecutor directly with an explicit forkserver mp_context,
    rather than tqdm.contrib.concurrent.process_map (which does not forward
    mp_context to the underlying executor, so the intended start method was
    silently ignored).

Behavior is otherwise unchanged (same inputs/outputs, same progress bar).

🤖 Generated with Claude Code

rasterio is not thread-safe; running repack across a thread pool can
corrupt/deadlock on some GDAL builds. Switch repack_rasters to a
process pool.

Use ProcessPoolExecutor directly with an explicit forkserver mp_context
rather than tqdm's process_map, which does not forward mp_context to the
underlying executor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.

1 participant