-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Add startup_check_interval_seconds to PodManager's await_pod_start #34231
Conversation
…er-m60/airflow into startup_check_interval
Refers to #31008. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add an else
after
airflow/airflow/providers/cncf/kubernetes/triggers/pod.py
Lines 171 to 184 in 1b122c1
if delta.total_seconds() >= self.startup_timeout: | |
message = ( | |
f"Pod took longer than {self.startup_timeout} seconds to start. " | |
"Check the pod events in kubernetes to determine why." | |
) | |
yield TriggerEvent( | |
{ | |
"name": self.pod_name, | |
"namespace": self.pod_namespace, | |
"status": "timeout", | |
"message": message, | |
} | |
) | |
return |
and await asyncio.sleep(self.startup_check_interval)
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
…pache#34231) * add startup_check_interval_seconds * change default value in method * fix static checks, add missing param, fix typo * default is 1s * fix outdated docs * add test to check time.sleep is called with specific value * add more documentation * rephrase * add startup_check_interval_seconds * change default value in method * fix static checks, add missing param, fix typo * default is 1s * fix outdated docs * add test to check time.sleep is called with specific value * add more documentation * rephrase * add sleep in else clause * Update airflow/providers/cncf/kubernetes/triggers/pod.py --------- Co-authored-by: eladkal <[email protected]> Co-authored-by: Hussein Awala <[email protected]>
Parametrize the interval in which the Kubernetes pod status is polled when launching a new pod.
When using serverless Kubernetes services like Google GKE Autopilot the pod startup time is sometimes expected to be longer due to a cold start. Therefore the logs might be spammed due to the default checks every second (see below), and a lower check frequency might be desired