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

Simplify "invalid TI state" message #19029

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

dstandish
Copy link
Contributor

@dstandish dstandish commented Oct 17, 2021

Currently in the web UI on task instance details page, if a task is in the "up for retry" state
we will see this message:

Task is in the up_for_retry state which is not a valid state for execution. The task must be cleared in order to be run.

First of all, there's nothing really "invalid" about this state -- it's expected that sometimes tasks will fail, then be in up-for-retry state before being retried. So, it is a valid state, and it will get picked up after the retry interval.

But the language "The task must be cleared in order to be run" suggests to the user "you need to clear this in order for this task to run". But this is not true.

Unfortunately it is not simple to make it clearer, because this function is used for a lot of different scenarios. For example, checking for "schedulable" tasks, and "queueable" tasks. So not only would we need to keep track of which states actually require user intervention, but the desired action (e.g. queue vs schedule vs run).

So I think the best course of action is to amend this to say less, i.e. to say only what is always true, which is simply the state.

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

When worse is actually better 🙂 This function being used under too many contexts is in itself a problem though; without thinking this too hard, is there refactoring available to improve the situation and provide the needed context for better error messages?

@dstandish
Copy link
Contributor Author

When worse is actually better 🙂

exactly :)

This function being used under too many contexts is in itself a problem though; without thinking this too hard, is there refactoring available to improve the situation and provide the needed context for better error messages?

I agree it could probably use a refactor but it doesn't seem super high priority.

Currently in the web UI on task instance details page, if a task is in the "up for retry" state
we will see this message:

"Task is in the up_for_retry state which is not a valid state for execution. The task must be cleared in order to be run."

This might suggest to the user "you need to clear this in order for this task to run".  But this is not true.  But it is not simple to make it clearer, because this function is used for a lot of different scenarios.  For example, checking for "schedulable" tasks, and "queueable" tasks. So not only would we need to keep track of which states actually require user intervention, but the desired action (e.g. queue vs schedule vs run).
So I think the best course of action is to simplify this to say only what is always true, and that is just the state.
@dstandish dstandish force-pushed the simplify-invalid-ti-state-dep-message branch from c981628 to d7b9e42 Compare October 18, 2021 06:26
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

Thoughts @ashb

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 2, 2021
@github-actions
Copy link

github-actions bot commented Nov 2, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@ashb ashb merged commit 72679be into apache:main Nov 4, 2021
@ashb
Copy link
Member

ashb commented Nov 4, 2021

Nice commit message too ❤️

@jedcunningham jedcunningham added this to the Airflow 2.2.3 milestone Dec 7, 2021
jedcunningham pushed a commit that referenced this pull request Dec 7, 2021
Currently in the web UI on task instance details page, if a task is in the "up for retry" state
we will see this message:

"Task is in the up_for_retry state which is not a valid state for execution. The task must be cleared in order to be run."

This might suggest to the user "you need to clear this in order for this task to run".  But this is not true.  But it is not simple to make it clearer, because this function is used for a lot of different scenarios.  For example, checking for "schedulable" tasks, and "queueable" tasks. So not only would we need to keep track of which states actually require user intervention, but the desired action (e.g. queue vs schedule vs run).
So I think the best course of action is to simplify this to say only what is always true, and that is just the state.

(cherry picked from commit 72679be)
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants