airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [1/3] incubator-airflow git commit: [AIRFLOW-738] Commit deleted xcom items before insert
Date Tue, 10 Jan 2017 08:06:07 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 7e691d3f6 -> 2d54d8abd

[AIRFLOW-738] Commit deleted xcom items before insert

A delete insert sequence within one transaction can lead
to a deadlocked transaction with Mariadb / MySQL.

The deletes, in case they affected no rows, all get a shared lock
(mode IX) on the end-of-table gap. Once the insert is executed,
the shared lock is still held by all threads,
and the insert intention waits for the release of this shared lock.

The solution is to not do the following in parallel:

1. Delete the rows you want to insert, when the rows aren't there.
2. Insert the rows

In this case the risk of not executing the delete and insert
is relatively low, as it was the users intention to run the
task. In case it fails in between the two transactions
the task can be tried.


Branch: refs/heads/master
Commit: e18d67dec4774946a35f7c34953bdfd7138595bf
Parents: 19ed900
Author: Bolke de Bruin <>
Authored: Mon Jan 9 22:04:35 2017 +0100
Committer: Bolke de Bruin <>
Committed: Mon Jan 9 22:10:42 2017 +0100

 airflow/ | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/airflow/ b/airflow/
index f6f7968..1a0919a 100755
--- a/airflow/
+++ b/airflow/
@@ -3515,6 +3515,8 @@ class XCom(Base):
             cls.task_id == task_id,
             cls.dag_id == dag_id).delete()
+        session.commit()
         # insert new XCom

View raw message