Skip to content

Commit

Permalink
fix: remove lock from log transaction handling in Vertex (#5906)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz authored Jan 24, 2025
1 parent 248de83 commit eff5eb6
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/backend/base/langflow/graph/vertex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from langflow.exceptions.component import ComponentBuildError
from langflow.graph.schema import INPUT_COMPONENTS, OUTPUT_COMPONENTS, InterfaceComponentTypes, ResultData
from langflow.graph.utils import UnbuiltObject, UnbuiltResult
from langflow.graph.utils import UnbuiltObject, UnbuiltResult, log_transaction
from langflow.interface import initialize
from langflow.interface.listing import lazy_load_dict
from langflow.schema.artifact import ArtifactType
Expand Down Expand Up @@ -632,17 +632,15 @@ async def _log_transaction_async(
target: Optional target vertex
error: Optional error information
"""
# Commenting this out for now
# async with self._lock:
# if self.log_transaction_tasks:
# # Safely await and remove completed tasks
# task = self.log_transaction_tasks.pop()
# await task

# # Create and track new task
# task = asyncio.create_task(log_transaction(flow_id, source, status, target, error))
# self.log_transaction_tasks.add(task)
# task.add_done_callback(self.log_transaction_tasks.discard)
if self.log_transaction_tasks:
# Safely await and remove completed tasks
task = self.log_transaction_tasks.pop()
await task

# Create and track new task
task = asyncio.create_task(log_transaction(flow_id, source, status, target, error))
self.log_transaction_tasks.add(task)
task.add_done_callback(self.log_transaction_tasks.discard)

async def _get_result(
self,
Expand Down

0 comments on commit eff5eb6

Please sign in to comment.