get_reranker() acquires the module-level _lock and then, on first load, calls unload() to clear any stale state before _load() instantiates the CrossEncoder. unload() acquires the same _lock — but threading.Lock is non-reentrant, so the second acquisition by the holding thread blocked forever. Symptom: rerank=True hung the search_knowledge_base tool with no further log output past 'rerank entered'. Switch to threading.RLock so the same thread can re-enter without blocking. unload()'s independent callers still work the same way; the only behaviour change is that re-entrant acquisition from one thread now succeeds. |
||
|---|---|---|
| .. | ||
| data_recipe | ||
| export | ||
| inference | ||
| rag | ||
| training | ||
| __init__.py | ||
| tool_healing.py | ||