Skip to content

Remove option ot set a task instance to running state in UI#36518

Merged
jscheffl merged 2 commits intoapache:mainfrom
boschglobal:bugfix/remove-set-taskinstance-running-option
Jan 5, 2024
Merged

Remove option ot set a task instance to running state in UI#36518
jscheffl merged 2 commits intoapache:mainfrom
boschglobal:bugfix/remove-set-taskinstance-running-option

Conversation

@jscheffl
Copy link
Copy Markdown
Contributor

Removes the "Set to state 'running'" option from UI for Task instances. If users are using this, immediately an "Zombie task" error like the following is produced in the task logs:

[2023-12-31, 18:57:01 CET] {scheduler_job_runner.py:1766} ERROR - Detected zombie job: {'full_filepath': '/opt/airflow/airflow/example_dags/example_params_ui_tutorial.py', 'processor_subdir': '/files/dags', 'msg': "{'DAG Id': 'example_params_ui_tutorial', 'Task Id': 'show_params', 'Run Id': 'manual__2023-12-31T18:56:01+01:00', 'Hostname': 'c01bb381ee62', 'External Executor Id': '0464fee6-8ba2-4a3b-87cc-f9c0d891bfa9'}", 'simple_task_instance': <airflow.models.taskinstance.SimpleTaskInstance object at 0x7f8ac6c4b6a0>, 'is_failure_callback': True} (See https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html#zombie-undead-tasks)

See also https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/tasks.html#zombie-undead-tasks

Reason for removal is that the setting to state "running" just creates an inconsistent state in the meta database, no background activity is started. For advanced user who know what they are doing, rather the API `HTTP PATCH /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}' is the right way. But we should not leave a standard option in the normal user UI as this is mis-leading.

closes: #35729

@jscheffl jscheffl added this to the Airflow 2.8.1 milestone Dec 31, 2023
@boring-cyborg boring-cyborg Bot added the area:webserver Webserver related Issues label Dec 31, 2023
@jscheffl jscheffl added type:bug-fix Changelog: Bug Fixes area:UI Related to UI/UX. For Frontend Developers. labels Dec 31, 2023
Comment thread airflow/www/views.py
Copy link
Copy Markdown
Member

@pankajkoti pankajkoti left a comment

Choose a reason for hiding this comment

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

Nice catch and fix 👏🏽 . Looks great to me. Would be nice to have another maintainer's review here.

Comment thread airflow/www/views.py
@jscheffl jscheffl requested review from dirrao and pankajastro January 1, 2024 20:31
@jscheffl jscheffl merged commit 60aa611 into apache:main Jan 5, 2024
ephraimbuddy pushed a commit that referenced this pull request Jan 11, 2024
* Remove option ot set a task instance to running state in UI
* Uups, fix pytests

(cherry picked from commit 60aa611)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting a task to run state doesn't do nothing

5 participants