Skip to content

fix(vectordb): handle Windows 11 platform.machine() empty string and circular import - #3019

Merged
qin-ctx merged 2 commits into
volcengine:mainfrom
huang-yi-dae:fix/vectordb-engine-windows11
Jul 8, 2026
Merged

fix(vectordb): handle Windows 11 platform.machine() empty string and circular import#3019
qin-ctx merged 2 commits into
volcengine:mainfrom
huang-yi-dae:fix/vectordb-engine-windows11

Conversation

@huang-yi-dae

Copy link
Copy Markdown
Contributor

Summary

  • _is_x86_machine(): On Windows 11 (build 26200), platform.machine() returns an empty string, causing the engine to incorrectly treat the CPU as non-x86 and attempt to load a non-existent native backend. Fix: default to x86 on win32 when the machine string is empty.
  • _module_exists(): importlib.util.find_spec() raises ModuleNotFoundError during module initialization because __path__ has not been assigned yet. This is a circular-import timing issue that makes the engine think zero backend variants are available. Fix: catch the exception and fall back to a filesystem .pyd check.

Test plan

  • _is_x86_machine() returns True when platform.machine() is empty on win32
  • Explicit machine override (AMD64, aarch64) still works correctly
  • _module_exists() does not crash when find_spec raises ModuleNotFoundError
  • Filesystem fallback correctly detects .pyd files

…circular import

- _is_x86_machine(): default to x86 on win32 when platform.machine()
  returns empty string (Windows 11 build 26200)
- _module_exists(): catch ModuleNotFoundError during module init when
  __path__ is not yet assigned, fall back to filesystem .pyd check
@qin-ctx
qin-ctx merged commit 9036d3f into volcengine:main Jul 8, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants