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

clear task's next_method and next_kwargs when clear the task #19640

Closed
wants to merge 2 commits into from

Conversation

Greetlist
Copy link

@Greetlist Greetlist commented Nov 17, 2021

clear task's next_method and next_kwargs when clear the task

closes: #19120
related: #19612

clear task's next_method and next_kwargs when clear the task

Signed-off-by: Greetlist <454281389@qq.com>
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 17, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@github-actions
Copy link

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.

@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 17, 2021
@Greetlist
Copy link
Author

It seems stuck at Tests/ Wait for CI images(pull_request), What can I do now?

@uranusjr uranusjr closed this Nov 19, 2021
@uranusjr uranusjr reopened this Nov 19, 2021
@uranusjr
Copy link
Member

Let it try again

@Greetlist Greetlist closed this Nov 19, 2021
@Greetlist Greetlist reopened this Nov 19, 2021
@Greetlist Greetlist closed this Nov 20, 2021
@Greetlist Greetlist reopened this Nov 20, 2021
@Greetlist Greetlist closed this Nov 29, 2021
@Greetlist Greetlist reopened this Nov 29, 2021
@uranusjr
Copy link
Member

I merged the latest upstream main to your branch so this can run against the latest CI configuration. There are some recent improvements that may help this pass CI.

@Greetlist
Copy link
Author

There are some failing checks which caused by AssertionError.
tests/jobs/test_scheduler_job.py

TestSchedulerJob::test_max_active_runs_creation_phasing():
    """
    Test that when creating runs once max_active_runs is reached that the runs come in the right order
    without gaps
    """

    ...
    ...

    expected_execution_dates = [datetime.datetime(2016, 1, d, tzinfo=timezone.utc) for d in range(1, 6)]
    dagrun_execution_dates = [
        dr.execution_date for dr in session.query(DagRun).order_by(DagRun.execution_date).all()
    ]
    assert dagrun_execution_dates == expected_execution_dates   #AssertionError

I check the error info, is the dagrun_execution_dates list missing some elements?I have no idea what goes wrong here.

@Greetlist Greetlist closed this Dec 9, 2021
@Greetlist Greetlist reopened this Dec 9, 2021
@@ -204,6 +204,7 @@ def clear_task_instances(
ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
ti.state = State.NONE
ti.external_executor_id = None
ti.clear_next_method_args()
Copy link
Member

Choose a reason for hiding this comment

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

Should we add some sort of unit test for it?

suggestions @uranusjr @dstandish ?

Copy link
Member

Choose a reason for hiding this comment

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

Some additional asserts in TestClearTasks should be good enough.

@kaxil kaxil linked an issue Dec 9, 2021 that may be closed by this pull request
2 tasks
@kaxil kaxil added this to the Airflow 2.2.3 milestone Dec 9, 2021
@dstandish
Copy link
Contributor

The description says this closes #19120 but that issue is already closed.

@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Dec 9, 2021
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jan 25, 2022
@github-actions github-actions bot closed this Jan 31, 2022
@Greetlist
Copy link
Author

Can I reopen this PR or start a new PR for it ?

@ashb ashb reopened this Feb 3, 2022
@github-actions github-actions bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 4, 2022
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Mar 21, 2022
@github-actions github-actions bot closed this Mar 27, 2022
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 stale Stale PRs per the .github/workflows/stale.yml policy file type:bug-fix Changelog: Bug Fixes
Projects
None yet
6 participants