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

Fix "Attempt 2 out of 1" messages #1229

Closed
jlowin opened this issue Mar 28, 2016 · 1 comment
Closed

Fix "Attempt 2 out of 1" messages #1229

jlowin opened this issue Mar 28, 2016 · 1 comment
Assignees

Comments

@jlowin
Copy link
Member

jlowin commented Mar 28, 2016

It's possible to get strange "Attempt 2 out of 1" status messages when Airflow forces a task to run after it's completed or previously run.

For example, this unit test in CoreTests prints such a message (https://github.com/airbnb/airflow/blob/aee3cacb1042dbdc26d9ba06d481c81948f418ec/tests/core.py#L467):

    def test_raw_job(self):
        TI = models.TaskInstance
        ti = TI(
            task=self.runme_0, execution_date=DEFAULT_DATE)
        ti.dag = self.dag_bash
        ti.run(force=True)

The "Attempt" message is built as

            tot_tries = task.retries + 1
            msg = "Attempt {} out of {}".format(self.try_number+1,
                                                tot_tries)
            self.try_number += 1

So every time the task gets loaded, the number of attempts is incremented. If the task is run an unexpected number of times, either due to prior failures or force runs, then this message becomes nonsensical. I think this is straightforward to fix by resetting self.try_number any time the task is run that ISN'T a retry.

@jlowin jlowin self-assigned this Mar 28, 2016
@jlowin
Copy link
Member Author

jlowin commented Mar 28, 2016

Closed by #1230

@jlowin jlowin closed this as completed Mar 28, 2016
mobuchowski pushed a commit to mobuchowski/airflow that referenced this issue Jan 4, 2022
* Add parent job facet to rdd integration

Signed-off-by: Michael Collado <mike@datakin.com>

* Add if debugEnabled check before converting logical plan to json

Signed-off-by: Michael Collado <mike@datakin.com>

* Add test to cover JDBC relation writes and made fixes

Signed-off-by: Michael Collado <mike@datakin.com>

* Changed plan visitor to use optimized plan to avoid unresolved expressions in plan

Signed-off-by: Michael Collado <mike@datakin.com>

* Added test to cover INSERT OVERWRITE DIRECTORY case and added necessary support code

Signed-off-by: Michael Collado <mike@datakin.com>

* PR comments

Signed-off-by: Michael Collado <mike@datakin.com>
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

No branches or pull requests

1 participant