SIENTIAPDE-1314

Enhance thread safety in MLFlowRepository model caching

- Introduced a reentrant lock to synchronize access to the model cache, ensuring thread safety during cache checks and updates.
- Updated the cache management logic to acquire the lock when checking for existing models and when updating the cache after downloading a new model.
- Reduced the maximum cached workflows in the worker configuration for improved resource management.
This commit is contained in:
vitor-aignosi
2025-10-27 13:29:01 -03:00
parent 1cbf356d0c
commit 67af03ee94
2 changed files with 21 additions and 17 deletions

View File

@@ -152,7 +152,7 @@ async def main():
max_concurrent_workflow_tasks=50,
max_concurrent_activities=50,
max_concurrent_local_activities=50,
max_cached_workflows=200,
max_cached_workflows=2,
workflow_task_poller_behavior=PollerBehaviorAutoscaling(),
activity_task_poller_behavior=PollerBehaviorAutoscaling(),
),
@@ -164,7 +164,6 @@ async def main():
# MLFlow
activities.request_predict,
activities.request_transform,
activities.query_to_minio,
# Gates
activities.input_gate,
activities.mlflow_response_gate,