close
Skip to content

KubernetesPodOperator should retry log tailing in case of interruption#11325

Merged
dimberman merged 7 commits into
apache:masterfrom
michalmisiewicz:AIRFLOW-11324
Oct 9, 2020
Merged

KubernetesPodOperator should retry log tailing in case of interruption#11325
dimberman merged 7 commits into
apache:masterfrom
michalmisiewicz:AIRFLOW-11324

Conversation

@michalmisiewicz
Copy link
Copy Markdown
Contributor

This PR adds ability for KubernetesPodOperator to retry log tailing in case of interruption, described in #11324.
I've also included fix for #10586. I've tested introducted changes to be stable when running modified version for several days.

Closes #11324 #10586

@boring-cyborg boring-cyborg Bot added the k8s label Oct 7, 2020
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Oct 7, 2020

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/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint 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

@michalmisiewicz
Copy link
Copy Markdown
Contributor Author

@kaxil @dimberman @mik-laj

@kaxil kaxil requested review from dimberman and msumit and removed request for msumit October 7, 2020 10:11
@michalmisiewicz michalmisiewicz changed the title KubernetesPodOperator can retry log tailing in case of interruption KubernetesPodOperator should retry log tailing in case of interruption Oct 7, 2020
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 7, 2020

The Build Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

Comment thread airflow/kubernetes/pod_launcher.py
@dimberman dimberman mentioned this pull request Oct 7, 2020
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 9, 2020

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@michalmisiewicz
Copy link
Copy Markdown
Contributor Author

New version fixes encoding.
Before

[2020-09-23 13:04:03,723] {pod_launcher.py:156} INFO - b'Max workers: 100\n'
[2020-09-23 13:04:09,569] {pod_launcher.py:156} INFO - b'All cases collected, total: 30000\n'

After

[2020-10-09 14:40:28,752] {pod_launcher.py:136} INFO - Max workers: 100
[2020-10-09 14:40:29,445] {pod_launcher.py:136} INFO - All cases collected, total: 30000

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 9, 2020

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@dimberman dimberman merged commit b7404b0 into apache:master Oct 9, 2020
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Oct 9, 2020

Awesome work, congrats on your first merged pull request!

@dimberman
Copy link
Copy Markdown
Contributor

Thank you for this @michalmisiewicz!

dimberman pushed a commit to astronomer/airflow that referenced this pull request Jan 25, 2021
apache#11325)

* KubernetesPodOperator can retry log tailing in case of interruption

* fix failing test

* change read_pod_logs method formatting

* KubernetesPodOperator retry log tailing based on last read log timestamp

* fix test_parse_log_line test  formatting

* add docstring to parse_log_line method

* fix kubernetes integration test

(cherry picked from commit b7404b0)
kaxil pushed a commit to astronomer/airflow that referenced this pull request Mar 16, 2021
apache#11325)

* KubernetesPodOperator can retry log tailing in case of interruption

* fix failing test

* change read_pod_logs method formatting

* KubernetesPodOperator retry log tailing based on last read log timestamp

* fix test_parse_log_line test  formatting

* add docstring to parse_log_line method

* fix kubernetes integration test

(cherry picked from commit b7404b0)
kaxil pushed a commit to astronomer/airflow that referenced this pull request Jun 2, 2021
apache#11325)

* KubernetesPodOperator can retry log tailing in case of interruption

* fix failing test

* change read_pod_logs method formatting

* KubernetesPodOperator retry log tailing based on last read log timestamp

* fix test_parse_log_line test  formatting

* add docstring to parse_log_line method

* fix kubernetes integration test

(cherry picked from commit b7404b0)
(cherry picked from commit 0138e6a)
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Jun 7, 2022
…n Internal bug

Cherry-picked: apache/airflow#11325

RELNOTES=BUGFIX

Change-Id: I898b3cdca4c75f120958f9ef86450187375a6dd4
GitOrigin-RevId: eb323cd29a47ef01e4d4f3060d4300a1a52281f1
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.

KubernetesPodOperator stops tailing logs in long living task

2 participants