You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eakmanrq (via GitHub)" <gi...@apache.org> on 2024/08/10 16:44:04 UTC
[PR] Properly implement termination grace period seconds [airflow]
eakmanrq opened a new pull request, #41374:
URL: https://github.com/apache/airflow/pull/41374
For services except Redis, this PR results in no behavior change but allows users to configure `terminationGracePeriodSeconds` if they want.
Redis is unusual in that the chart had an entry for `terminationGracePeriodSeconds` already with a default of 600. So it seems the author wanted Redis to have a grace period of 600 but actually was getting 30 since it wasn't properly configured. Therefore I properly added the `terminationGracePeriodSeconds` for Redis which will change the behavior from 30 seconds (since one wasn't provided) to 600. I could also change the default to 30 to maintain current behavior but my interpretation of the chart is that current behavior is a bug. A longer termination grace period seconds for Redis can make sense if you want to ensure you don't have data loss.
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1716085172
##########
airflow/providers/fab/auth_manager/cli_commands/user_command.py:
##########
@@ -212,10 +212,10 @@ def users_import(args):
users_created, users_updated = _import_users(users_list)
if users_created:
- print("Created the following users:\n\t{}".format("\n\t".join(users_created)))
+ print(f"Created the following users:\n\t{'\\n\\t'.join(users_created)}")
Review Comment:
Oh I see running style did this. Must be a misconfiguration on my end. Will fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1715531561
##########
chart/values.schema.json:
##########
@@ -5363,6 +5368,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for webserver to finish after SIGTERM is sent from Kubernetes.",
+ "type": "integer",
+ "default": 30
Review Comment:
Gotcha, let's keep it like you did.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2287545418
Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1712972408
##########
chart/values.schema.json:
##########
@@ -2404,6 +2404,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for tasks to finish after SIGTERM is sent from Kubernetes.",
Review Comment:
isn't is should be
```suggestion
"description": "Grace period for scheduler to finish after SIGTERM is sent from Kubernetes.",
```
##########
chart/values.schema.json:
##########
@@ -5363,6 +5368,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for webserver to finish after SIGTERM is sent from Kubernetes.",
+ "type": "integer",
+ "default": 30
Review Comment:
in all current deployment this value is 60.
why you choose 30? (apply for others)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1716087963
##########
airflow/providers/fab/auth_manager/cli_commands/user_command.py:
##########
@@ -212,10 +212,10 @@ def users_import(args):
users_created, users_updated = _import_users(users_list)
if users_created:
- print("Created the following users:\n\t{}".format("\n\t".join(users_created)))
+ print(f"Created the following users:\n\t{'\\n\\t'.join(users_created)}")
Review Comment:
Fixed: https://github.com/apache/airflow/pull/41374/commits/ac2af646d7866446e26498a7a01d0bf58e814c32
Thanks for catching that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2282742123
can you please add tests for your changes?
you can find more information about testing helm [here](https://github.com/romsharon98/airflow/blob/main/contributing-docs/testing/helm_unit_tests.rst)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1714040342
##########
chart/values.schema.json:
##########
@@ -2404,6 +2404,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for tasks to finish after SIGTERM is sent from Kubernetes.",
Review Comment:
Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1716083991
##########
airflow/providers/fab/auth_manager/cli_commands/user_command.py:
##########
@@ -212,10 +212,10 @@ def users_import(args):
users_created, users_updated = _import_users(users_list)
if users_created:
- print("Created the following users:\n\t{}".format("\n\t".join(users_created)))
+ print(f"Created the following users:\n\t{'\\n\\t'.join(users_created)}")
Review Comment:
Yeah I actually didn't make those changes. I think someone else updated my branch. Either way I will reverse it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1716082314
##########
airflow/providers/fab/auth_manager/cli_commands/user_command.py:
##########
@@ -212,10 +212,10 @@ def users_import(args):
users_created, users_updated = _import_users(users_list)
if users_created:
- print("Created the following users:\n\t{}".format("\n\t".join(users_created)))
+ print(f"Created the following users:\n\t{'\\n\\t'.join(users_created)}")
Review Comment:
Can you undo these changes @eakmanrq ? 1) its breaking the image build and 2) we try to keep PRs isolated if possible (this is a provider, while the rest is the helm chart).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "romsharon98 (via GitHub)" <gi...@apache.org>.
romsharon98 commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1715139256
##########
chart/values.schema.json:
##########
@@ -5363,6 +5368,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for webserver to finish after SIGTERM is sent from Kubernetes.",
+ "type": "integer",
+ "default": 30
Review Comment:
I meant that the terminationGracePeriodSeconds in other components equal to 60.
[tigerrer](https://github.com/apache/airflow/blob/main/chart/values.yaml#L1579)
[dag processor](https://github.com/apache/airflow/blob/main/chart/values.yaml#L1766)
It's better to keep `terminationGracePeriodSeconds` consistent across all components unless there's a stronger reason to do otherwise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1714041676
##########
chart/values.schema.json:
##########
@@ -5363,6 +5368,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for webserver to finish after SIGTERM is sent from Kubernetes.",
+ "type": "integer",
+ "default": 30
Review Comment:
Hmm I need to better understand why you are thinking the current value is 60. If you don't provide a `terminationGracePeriodSeconds` then kubernetes itself will default to 30.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2284463653
@romsharon98
Added tests and addressed typo: https://github.com/apache/airflow/pull/41374/commits/f980282c461a0f6424acc056930780388e426ea3
Looking for more feedback on the 60 second concern.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2287568507
> Thanks @eakmanrq! Congrats on your first commit 🎉
>
> So close to being the 3,000th contributor, but alas you are the 2,999th (still kinda cool imo).
Wow congrats to you all! That says so much about the impact Airflow has had and the great community that has grown around it. 🚀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2287548124
Thanks @eakmanrq! Congrats on your first commit 🎉
So close to being the 3,000th contributor, but alas you are the 2,999th (still kinda cool imo).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2282205878
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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-pre-commit-hooks) 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](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) 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](https://www.apache.org/foundation/policies/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]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2284390238
> can you please add tests for your changes? you can find more information about testing helm [here](https://github.com/romsharon98/airflow/blob/main/contributing-docs/testing/helm_unit_tests.rst)
Ah this is great, I missed there were tests for Helm. Will update with tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "eakmanrq (via GitHub)" <gi...@apache.org>.
eakmanrq commented on code in PR #41374:
URL: https://github.com/apache/airflow/pull/41374#discussion_r1715509261
##########
chart/values.schema.json:
##########
@@ -5363,6 +5368,11 @@
],
"default": null
},
+ "terminationGracePeriodSeconds": {
+ "description": "Grace period for webserver to finish after SIGTERM is sent from Kubernetes.",
+ "type": "integer",
+ "default": 30
Review Comment:
The reason why I didn't do this is because this would result in a behavior change for these components. My goal was to make `terminationGracePeriodSeconds` configurable for more components while preserving existing behavior. I'm open though if we would also like to change the existing behavior to make it more consistent if we want to do that too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham merged PR #41374:
URL: https://github.com/apache/airflow/pull/41374
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Properly implement termination grace period seconds [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #41374:
URL: https://github.com/apache/airflow/pull/41374#issuecomment-2287553411
> So close to being the 3,000th contributor, but alas you are the 2,999th (still kinda cool imo).
👀👀👀👀👀👀👀👀👀👀👀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org