Skip to content

Conversation

@JiangZhihao123
Copy link

Summary

Fixes #5937

On Windows, the Rust bindings (chromadb_rust_bindings.pyd) cause collection.add() to hang indefinitely. This PR defaults to using SegmentAPI on Windows platform as a workaround until the underlying Rust issue is resolved.

Root Cause

The chromadb_rust_bindings.Bindings.add() method never returns on Windows. This was identified through Python line-by-line tracing using sys.settrace().

Changes

  • Added import platform to chromadb/config.py
  • Modified default chroma_api_impl to use SegmentAPI on Windows, RustBindingsAPI on other platforms

Testing

  • Tested on Windows 10/11 with Python 3.10/3.11
  • collection.add() now completes successfully on Windows
  • No impact on Linux/macOS (still uses Rust bindings)

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

Default Windows API to SegmentAPI to avoid hang

Updates the default chroma_api_impl configuration so that Windows installs use SegmentAPI, bypassing the hanging RustBindingsAPI. The change leverages platform.system() at import time to select the appropriate backend while leaving non-Windows platforms unchanged.

Key Changes

• Imported platform at the top of chromadb/config.py
• Set chroma_api_impl to chromadb.api.segment.SegmentAPI when platform.system() == "Windows", otherwise keep chromadb.api.rust.RustBindingsAPI

Affected Areas

• chromadb/config.py

This summary was automatically generated by @propel-code-bot

import importlib
import inspect
import logging
import platform
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advisory

[Style] This newly added import platform statement creates a duplicate, as another import platform exists on line 14. Please remove the redundant import on line 14 to keep the codebase clean.

Context for Agents
This newly added `import platform` statement creates a duplicate, as another `import platform` exists on line 14. Please remove the redundant import on line 14 to keep the codebase clean.

File: chromadb/config.py
Line: 4

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.

[Bug]: collection.add() hangs indefinitely on Windows with Rust bindings (v1.3.5)

1 participant