langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Deadlocks in transactions table after upgrading to Langflow 1.5

Open a6santa opened this issue 4 months ago • 5 comments

Bug Description

After upgrading from Langflow 1.4 to 1.5, we started experiencing frequent deadlocks in the transactions table. The system had been running smoothly before the upgrade, but now, every day around 10:00 AM, the database session count spikes and eventually stalls due to deadlocks.

Environment details:

AWS ECS with 5 tasks

Shared disk: OFS

Database: AWS RDS PostgreSQL

Previous version: 1.4 (no issues)

Current version: 1.5 (deadlocks occur daily)

Image Image

Reproduction

Run Langflow 1.5 with the configuration above.

Wait until approximately 10:00 AM UTC-3.

Monitor RDS and note the deadlocks in the transactions table.

Expected behavior

  • Is there a way to disable or bypass the automatic DELETE behavior causing these deadlocks until a fix is released?
  • No deadlocks, same stability as in version 1.4.

Who can help?

No response

Operating System

ECS

Langflow Version

1.5

Python Version

None

Screenshot

No response

Flow File

No response

a6santa avatar Aug 14 '25 13:08 a6santa

The same problem happens in SQLite

daniel-allt avatar Aug 18 '25 01:08 daniel-allt

@a6santa Do you have a large transaction volume? We're investigating an issue with flows with more than 3,000 transactions, and this issue may be related.

@daniel-allt SQLITE is not suitable for production because it does not allow concurrent transactions. How much transaction volume do you have in your scenario?

Empreiteiro avatar Aug 18 '25 17:08 Empreiteiro

@daniel-allt Yes, we do. We fixed this problem by stopping the log from being saved in this table, applying the LANGFLOW_TRANSACTIONS_STORAGE_ENABLED environment variable as False. But there should be a solution without this

a6santa avatar Aug 18 '25 17:08 a6santa

https://github.com/langflow-ai/langflow/pull/9399/files

Empreiteiro avatar Aug 28 '25 13:08 Empreiteiro

If you haven't tried, this can detect and report deadlocks SELECT sum(deadlocks) FROM pg_stat_database

zzzming avatar Nov 13 '25 17:11 zzzming