[
https://issues.apache.org/jira/browse/AIRFLOW-3110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16627858#comment-16627858
]
Subu commented on AIRFLOW-3110:
-------------------------------
Chatted with ash on slack - apparently the callbacks are meant to allow changes
to current session.
For now I will use the task instance sent in context instead of relying on sql
query.
BUT the original issue kinda remains: task success callbacks differ from
failure callbacks. You might want to take a look. For me this is low pri now
-thanks!
Thanks
> Session not committed before failure callback, but is committed before
> success.
> -------------------------------------------------------------------------------
>
> Key: AIRFLOW-3110
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3110
> Project: Apache Airflow
> Issue Type: Bug
> Reporter: Subu
> Priority: Major
>
> Folks,
> The below line ideally should have a
> ```
> if not test_mode:
> session.merge(self)
> session.commit()
> ```
> [https://github.com/HanaDB/incubator-airflow/blob/master/airflow/models.py#L1815]
> before or after it.
> Else as of today we are not able to access the latest session information
> using sqlalchemy from failure callbacks.
> I see the same in DAG callbacks as well - the session state is committed
> after the callbacks.
> https://github.com/apache/incubator-airflow/blob/27a8a92f5d51843681fa4b74197781fdbea6a8be/airflow/models.py#L5207
> Could these locations be changed to commit before the callbacks?
> I don't know if this change is safe because I lack context elsewhere -so
> cutting a JIRA.
>
> Thanks, Subu
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)