Skip to content

Conversation

@bolkedebruin
Copy link
Contributor

@bolkedebruin bolkedebruin commented Jun 2, 2016

Dear Airflow Maintainers,

Please accept this PR that addresses the following issues:

Reminders for contributors:

Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder about this logic. Is it possible to get an AirflowException for another reason, and erroneously set the state to REMOVED?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really. Removed is set when the task
Does not exist in the DAG. This exception is thrown when the task does not exist in task dictionary of the DAG.

Copy link
Member

@jlowin jlowin Jun 3, 2016

Choose a reason for hiding this comment

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

So is the guard (if self.state is not State.RUNING) against it running to protect against this situation:

  1. Task starts running
  2. While task is running, DAG is modified and task is removed
  3. We don't want to interrupt the running task, that's what this guard is for

If so do you mind just commenting the logic to clarify?

@criccomini
Copy link
Contributor

LGTM

This patch adds schedule_dag and process_dag unittests. It also
fixes some minor bugs that were caught by these tests. Some
small changes for readability.
@bolkedebruin bolkedebruin changed the title Add scheduler tests and improve lineage handling [AIRFLOW-209] Add scheduler tests and improve lineage handling Jun 3, 2016
queue.put.assert_not_called()

def test_scheduler_do_not_schedule_removed_task(self):
dag = DAG(
Copy link
Member

Choose a reason for hiding this comment

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

The DAG creation code is very repetitive and I think it will be useful for future tests. Maybe you could refactor it into a helper function?

@jlowin
Copy link
Member

jlowin commented Jun 3, 2016

+1

@asfgit asfgit merged commit fb5a3b3 into apache:master Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants