Deadlocks in transactions table after upgrading to Langflow 1.5
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)
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
The same problem happens in SQLite
@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?
@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
https://github.com/langflow-ai/langflow/pull/9399/files
If you haven't tried, this can detect and report deadlocks
SELECT sum(deadlocks) FROM pg_stat_database