Skip to content

Commit

Permalink
Fix edge in rare conditions that task state can not be reported as cl…
Browse files Browse the repository at this point in the history
…eaned in parallel
  • Loading branch information
jscheffl committed Nov 23, 2024
1 parent b1e0212 commit 39f6237
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions providers/src/airflow/providers/edge/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
Changelog
---------

0.6.2pre0
.........

Misc
~~~~

* ``Fix race that reporting status fails if the task has been cleaned in parallel.``

0.6.1pre0
.........

Expand Down
2 changes: 1 addition & 1 deletion providers/src/airflow/providers/edge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

__all__ = ["__version__"]

__version__ = "0.6.1pre0"
__version__ = "0.6.2pre0"

if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
"2.10.0"
Expand Down
7 changes: 4 additions & 3 deletions providers/src/airflow/providers/edge/models/edge_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ def set_state(task: TaskInstanceKey | tuple, state: TaskInstanceState, session:
EdgeJobModel.try_number == task.try_number,
)
job: EdgeJobModel = session.scalar(query)
job.state = state
job.last_update = timezone.utcnow()
session.commit()
if job:
job.state = state
job.last_update = timezone.utcnow()
session.commit()

def __hash__(self):
return f"{self.dag_id}|{self.task_id}|{self.run_id}|{self.map_index}|{self.try_number}".__hash__()
Expand Down
2 changes: 1 addition & 1 deletion providers/src/airflow/providers/edge/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ source-date-epoch: 1729683247

# note that those versions are maintained by release manager - do not update them manually
versions:
- 0.6.1pre0
- 0.6.2pre0

dependencies:
- apache-airflow>=2.10.0
Expand Down

0 comments on commit 39f6237

Please sign in to comment.