Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplication of Task tries in the UI #43891

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

ephraimbuddy
Copy link
Contributor

It was observed that there are moments where the TI tries endpoint returns duplicate TaskInstance. I have observed this to happen when the TI is in up_for_retry state.

When the TI is in up_for_retry state, we have already recorded the previous try in TI history and the TI try_number has not incremented at this time, so we must exclude this recorded TI from the taskinstance tries endpoint. We know the TI because its state is in up_for_retry, so we filter TIs with up_for_retry state when querying for the task instance tries.

Closes: #41765

It was observed that there are moments where the TI tries endpoint returns duplicate
TaskInstance. I have observed this to happen when the TI is in up_for_retry state.

When the TI is in up_for_retry state, we have already recorded the previous try
in TI history and the TI try_number has not incremented at this time, so we must
exclude this recorded TI from the taskinstance tries endpoint. We know the TI because
its state is in up_for_retry, so we filter TIs with up_for_retry state when querying
for the task instance tries.

Closes: apache#41765
@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Nov 11, 2024
@ephraimbuddy ephraimbuddy added the legacy api Whether legacy API changes should be allowed in PR label Nov 11, 2024
@ephraimbuddy ephraimbuddy reopened this Nov 11, 2024
@ephraimbuddy ephraimbuddy added this to the Airflow 2.10.4 milestone Nov 11, 2024
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kandharvishnu when migrating this to FastAPI

@potiuk potiuk merged commit 4bc1257 into apache:main Nov 12, 2024
84 of 86 checks passed
@ephraimbuddy ephraimbuddy deleted the fix-try-duplication branch November 12, 2024 07:29
ephraimbuddy added a commit to astronomer/airflow that referenced this pull request Nov 13, 2024
It was observed that there are moments where the TI tries endpoint returns duplicate
TaskInstance. I have observed this to happen when the TI is in up_for_retry state.

When the TI is in up_for_retry state, we have already recorded the previous try
in TI history and the TI try_number has not incremented at this time, so we must
exclude this recorded TI from the taskinstance tries endpoint. We know the TI because
its state is in up_for_retry, so we filter TIs with up_for_retry state when querying
for the task instance tries.

Closes: apache#41765
(cherry picked from commit 4bc1257)
pierrejeambrun pushed a commit that referenced this pull request Nov 13, 2024
It was observed that there are moments where the TI tries endpoint returns duplicate
TaskInstance. I have observed this to happen when the TI is in up_for_retry state.

When the TI is in up_for_retry state, we have already recorded the previous try
in TI history and the TI try_number has not incremented at this time, so we must
exclude this recorded TI from the taskinstance tries endpoint. We know the TI because
its state is in up_for_retry, so we filter TIs with up_for_retry state when querying
for the task instance tries.

Closes: #41765
(cherry picked from commit 4bc1257)
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
It was observed that there are moments where the TI tries endpoint returns duplicate
TaskInstance. I have observed this to happen when the TI is in up_for_retry state.

When the TI is in up_for_retry state, we have already recorded the previous try
in TI history and the TI try_number has not incremented at this time, so we must
exclude this recorded TI from the taskinstance tries endpoint. We know the TI because
its state is in up_for_retry, so we filter TIs with up_for_retry state when querying
for the task instance tries.

Closes: apache#41765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API legacy api Whether legacy API changes should be allowed in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate entries in API response when TaskInstanceHistory and TaskInstance have same maximum try number
3 participants