Skip to content

fix: join Ray pools after closing#4751

Merged
chenghao-guo merged 1 commit into
lance-format:mainfrom
hfutatzhanghb:codex/join-ray-pool
May 19, 2026
Merged

fix: join Ray pools after closing#4751
chenghao-guo merged 1 commit into
lance-format:mainfrom
hfutatzhanghb:codex/join-ray-pool

Conversation

@hfutatzhanghb
Copy link
Copy Markdown
Contributor

@hfutatzhanghb hfutatzhanghb commented May 15, 2026

Summary

  • Call pool.join() after pool.close() in the Ray Pool cleanup paths for distributed indexing, add_columns, and compaction.
  • Add a unit test covering the shared index Pool helper cleanup order.

Why

ray.util.multiprocessing.Pool follows the multiprocessing-style lifecycle: close() prevents new work and lets outstanding actor work finish, but it does not wait for the Pool actors to exit. join() is the call that waits for actors in a closed Pool to stop.

These code paths already wait for map_async(...).get() before returning results, so this does not change result collection semantics. It makes worker actor cleanup deterministic after successful and failed runs, reducing the chance of transient Ray actor/resource leftovers across repeated operations or tests.

Validation

  • python -m py_compile lance_ray/index.py lance_ray/io.py lance_ray/compaction.py tests/test_vector_index_options.py
  • python -m pytest tests/test_vector_index_options.py
  • uv run --no-sync ruff check lance_ray/index.py tests/test_vector_index_options.py
  • git diff --check

@github-actions github-actions Bot added the bug Something isn't working label May 15, 2026
@hfutatzhanghb
Copy link
Copy Markdown
Contributor Author

@chenghao-guo Hi, could you help reviewing this PR when have free time? Thanks very much!!!

@hfutatzhanghb hfutatzhanghb marked this pull request as ready for review May 18, 2026 01:46
@hfutatzhanghb hfutatzhanghb force-pushed the codex/join-ray-pool branch from 9e7fde3 to b35d1c5 Compare May 18, 2026 09:28
@hfutatzhanghb hfutatzhanghb force-pushed the codex/join-ray-pool branch from b35d1c5 to be9ec7b Compare May 18, 2026 09:34
@chenghao-guo chenghao-guo merged commit a517fd2 into lance-format:main May 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants