refactor(thread-pool): make CPU affinity opt-in (#623)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
import inspect
|
||||
import pytest
|
||||
import tempfile
|
||||
import os
|
||||
@@ -149,6 +150,16 @@ class TestDbConfigMemoryLimitValidation:
|
||||
|
||||
|
||||
class TestDbConfigThreadValidation:
|
||||
def test_thread_binding_options_are_not_exposed(self):
|
||||
parameters = inspect.signature(zvec.init).parameters
|
||||
assert "query_thread_binding" not in parameters
|
||||
assert "optimize_thread_binding" not in parameters
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
zvec.init(query_thread_binding=True)
|
||||
with pytest.raises(TypeError):
|
||||
zvec.init(optimize_thread_binding=True)
|
||||
|
||||
@run_in_subprocess
|
||||
def test_query_threads(self):
|
||||
zvec.init(query_threads=1)
|
||||
|
||||
+2
-1
@@ -81,7 +81,8 @@ def init(
|
||||
Must be ≥ 1 if provided.
|
||||
optimize_threads (Optional[int], optional):
|
||||
Threads for background tasks (e.g., compaction, indexing).
|
||||
If ``None``, defaults to same as ``query_threads`` or CPU count.
|
||||
If ``None`` (default), uses the same environment-aware default as
|
||||
``query_threads``.
|
||||
invert_to_forward_scan_ratio (Optional[float], optional):
|
||||
Threshold to switch from inverted index to full forward scan.
|
||||
Range: [0.0, 1.0]. Higher → more aggressive index skipping.
|
||||
|
||||
Reference in New Issue
Block a user