Non-positive worker counts wait for results without starting workers
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start with the ParallelWorkerPool constructor in fastembed/parallel_processor.py, where num_workers is stored and queues are allocated. Add a check that raises ValueError for zero or negative values before any queue or process is created. Run the reproduction from the issue with num_workers=0 and -1 and confirm it fails immediately. Public parallel=0 must still resolve to a positive pool size.
Written by the indexing model from the issue text.
Description
ParallelWorkerPool accepts zero or negative worker counts and then waits for results with no worker processes. With the default timeout, a non-empty input can wait ten minutes before raising queue.Empty.
Reproduced on main at f48af32 with Python on Linux.
from fastembed.parallel_processor import ParallelWorkerPool, Worker
pool = ParallelWorkerPool(0, Worker)
list(pool.ordered_map([1]))
The same happens with num_workers=-1. I reproduced both cases with a shortened timeout of 0.02 seconds to avoid the ten-minute wait. No worker process was created. The normal timeout is 600 seconds.
Public embedding calls with negative parallel can reach this path when the input is large enough to use workers. A pool should reject non-positive worker counts immediately with ValueError, before allocating queues. Public parallel=0 continues to mean automatic CPU selection and resolves to a positive pool size.
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 276
- Avg merge
- 13h 15m
- Merged PRs (30d)
- 57
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/fastembed
-
Late interaction normalization produces nonfinite float16 embeddingsPossibly taken @IlyaKhalafi claimed this 2 days ago. Open
Difficulty 3/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Worker crashes go unnoticed while waiting for a resultPossibly taken @IlyaKhalafi claimed this 2 days ago. Open
Difficulty 3/5 Half a day Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Failed worker pool construction raises an extra destructor exceptionPossibly taken @IlyaKhalafi claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
[Bug]: rerank_pairs raises TypeError when pairs are passed as a tuple of pairsPossibly taken @michaelkillgta claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
[Feature]: Support huggingface-hub 2.0Possibly taken @joein claimed this 18 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 65/100
qdrant/fastembed#742 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in qdrant/fastembed
Similar issues
-
bug needs-triage priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
yeongseon/azure-functions-logging-python#583 ·
Maintainers usually reply within 1 day
-
documentation needs-triage priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
yeongseon/azure-functions-validation-python#546 ·
Maintainers usually reply within 1 day
-
PHP workflow streaming requests buffer the full SSE responsePossibly taken @Winoren claimed this today. Openreview: medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
langgenius/dify#44270 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
P4: low
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jeffknupp/association#523 ·
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
DarkStarSystems/pcons#229 ·
Maintainers usually reply within 1 day