Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix: use RLock in ResourceScheduler to prevent deadlock

d4ndr4d3c45b4b5d4c02
diff --git a/semantica/pipeline/resource_scheduler.py b/semantica/pipeline/resource_scheduler.py
index 324a0df0..e81407c1 100644
--- a/semantica/pipeline/resource_scheduler.py
+++ b/semantica/pipeline/resource_scheduler.py
@@ -109,7 +109,7 @@ class ResourceScheduler:
self.resources: Dict[str, Resource] = {}
self.allocations: Dict[str, ResourceAllocation] = {}
- self.lock = threading.Lock()
+ self.lock = threading.RLock() # RLock: allocate_resources holds lock and calls allocate_cpu/memory/gpu which also acquire it
self._initialize_resources()