-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Simplify "invalid TI state" message #19029
Conversation
There was a problem hiding this 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?
exactly :)
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.
c981628
to
d7b9e42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts @ashb
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. |
Nice commit message too ❤️ |
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)
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:
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.