NVIDIA-NeMo / NVIDIA-NeMo/Guardrails

bug: Race conditions and deadlock possible in embeddings/basic.py

Open
#1,476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
7.2k
Forks
842
Avg merge
3d 1h
Merged PRs (30d)
25

Description

Did you check docs and existing issues?
  • I have read all the NeMo-Guardrails docs
  • I have updated the package to the latest version before submitting this issue
  • (optional) I have used the develop branch
  • I have searched the existing issues of NeMo-Guardrails
Python version (python --version)

Python 3.13.2

Operating system/version

MacOS Tahoe 26.0.1

NeMo-Guardrails version (if you must use a specific version and not the latest

latest

Describe the bug

While reviewing #1383, several possible race and deadlock conditions were identified in the embeddings/basic.py file:

Steps To Reproduce

Identified statically from code analysis

Expected Behavior

Expect embeddings index not to hang or deadlock

Actual Behavior

Possible hang and/or deadlock when building index

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect embeddings/basic.py and the three linked discussions from pull request #1383, starting with the event and locking logic involved in index construction. Verify the identified race and deadlock paths under concurrent index building; done means embeddings index construction no longer hangs, deadlocks, or raises spurious RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.