mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
Fix deadlock by using RLock instead of Lock
- Replace threading.Lock() with threading.RLock() (reentrant lock) - Prevents deadlock when _initialize_chunker/_initialize_code_chunker call _initialize_embedding_model while holding the lock - RLock allows same thread to re-acquire lock safely Addresses critical PR #17 review feedback
This commit is contained in:
parent
d5fba5ae1a
commit
af1013fc1d
1 changed files with 1 additions and 1 deletions
|
|
@ -184,7 +184,7 @@ class Config:
|
||||||
_chunker_instance = None
|
_chunker_instance = None
|
||||||
_code_chunker_instance = None
|
_code_chunker_instance = None
|
||||||
_reranker_instance = None
|
_reranker_instance = None
|
||||||
_init_lock = threading.Lock() # Thread-safety lock for lazy initialization
|
_init_lock = threading.RLock() # Reentrant lock for nested initialization calls
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _initialize_embedding_model(cls):
|
def _initialize_embedding_model(cls):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue