Skip to content

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
@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
utkarsharma2 pushed a commit that referenced this pull request Dec 4, 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)
utkarsharma2 pushed a commit that referenced this pull request Dec 9, 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)
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