Skip to content

Avoid destructor errors after failed worker pool construction - #815

Merged
joein merged 2 commits into
qdrant:mainfrom
IlyaKhalafi:fix/pool-construction-cleanup
Oct 28, 2026
Merged

joein merged 2 commits into
qdrant:mainfrom
IlyaKhalafi:fix/pool-construction-cleanup

Conversation

@IlyaKhalafi

Copy link
Copy Markdown
Contributor

This PR fixes an extra destructor exception when worker pool construction rejects a start method. With this, callers see the original ValueError while partial pool cleanup completes quietly.

Fixes #814.

The new regression test failed before the fix. 8 focused tests and pre-commit passed. The existing early-close worker test was excluded because it also fails on upstream in this environment.

Checklist

  • Followed the contributing guidelines
  • Checked for duplicate pull requests
  • Added regression coverage

@IlyaKhalafi
IlyaKhalafi requested a review from joein as a code owner October 14, 2026 08:59
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1736b81d-2134-420c-930f-975822e63e7a
📥 Commits

Reviewing files that changed from the base of the PR and between f48af32 and 003cd5d.

📒 Files selected for processing: 2
  • fastembed/parallel_processor.py
  • tests/test_parallel_processor.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

ParallelWorkerPool now initializes processes before ctx. A regression test verifies that an unsupported start method raises the expected ValueError and that garbage collection does not report an unraisable error.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · previous review 003cd

An unsupported start method continues to raise ValueError without an additional destructor exception. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description directly explains the destructor-error fix, the affected worker-pool construction path, the regression test, and validation results.
Title check Passed The title clearly and concisely summarizes the main change: preventing destructor errors after failed worker-pool construction.
Linked Issues check Passed The change addresses issue #814. ParallelWorkerPool.__init__ initializes self.processes before get_context(start_method). An invalid start method can therefore raise the original ValueError wi…
Out of Scope Changes check Passed The pull request changes only fastembed/parallel_processor.py and tests/test_parallel_processor.py. The production change supports safe cleanup after failed construction. The test directly verifie…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@joein
joein merged commit b84642e into qdrant:main Oct 28, 2026
10 checks passed
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.

Failed worker pool construction raises an extra destructor exception

2 participants